tech-pkg archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: String offset errors on evbarm 8.99 [PR 54159]



On Sun, Aug 04, 2019 at 11:45:26AM +0200, tlaronde wrote:
> Hello,
> 
> When compiling packages for earmv7hf and NetBSD 8.99.50, some shared
> libraries created provoke the following type of messages from ld:
> 
> somelib.so: invalid string offset 2371 >= 25 for section `.strtab
> 
> (FWIW, the offset increases with the record while the stated size of
> the section doesn't.)
> 
> I have tried to reduce a test case to the minimum, using for example:
> 
> security/p11-kit
> 
> that exhibits the problem but when I compile and 
> assemble in a shared library invoking directly the compiler, there
> is no problem (and I have no problem with my own programs and shared
> libraries using the native tool-chain or the cross-compiled
> tool-chain; and cross-compiling the whole NetBSD distribution doesn't
> exhibit the problem either).
> 
> So it seems that the problem is created by the invocation of libtool.
> 
> I do not use libtool and don't fancy diving into it and its relations
> to the pkgsrc framework.
> 
> If someone with more knowledge than me (not difficult) about libtool
> and pkgsrc could have a look to see if the version of libtool
> furnished/requested by pkgsrc is not up-to-date with the version
> of binutils shipping with 8.99 or if there are some libtool options
> that can not be used with earmv7(hf) it will, IMHO, help to solve
> the issue.
> 

Just a supplementary tip:

For the shared libraries that ld complain about, the .strtab section is
indeed too short. The section exists (one must use readelf and not
objdump):

<xcomp-tooldir-bin>/readelf -S libp11-kit.so.0.3.0

There are 37 section headers, starting at offset 0x501554:

Section Headers:
  [Nr] Name              Type            Addr     Off    Size   ES Flg Lk Inf Al
  [ 0]                   NULL            00000000 000000 000000 00      0   0  0
  [..]
  [35] .strtab           STRTAB          00000000 500a30 0009bf 00      0   0  1

and the size of the section matches what is displayed by ld:
<xcomp-tooldir-bin>/ld: libp11-kit.so.0.3.0: invalid string offset 8626 >= 2495 for section `.strtab'

(2495 == 0009bf)

and the section is obviously far incomplete:

<xcomp-tooldir-bin>/readelf -p .strtab libp11-kit.so.0.3.0

String dump of section '.strtab':
  [     1]  $d
  [     4]  $a
  [     7]  p11_kit_modules_release
  [    1f]  p11_kit_pin_get_length
  [    36]  p11_kit_pin_request
  [    4a]  p11_kit_registered_module_to_name
  [    6c]  p11_kit_uri_set_module_path
  [    88]  p11_kit_uri_set_pinfile
  [    a0]  p11_kit_uri_set_pin_value
  [    ba]  p11_kit_uri_get_attribute
  [    d4]  p11_kit_finalize_module
  [    ec]  p11_kit_pin_ref
  [    fc]  p11_kit_modules_load
  [   111]  p11_kit_iter_destroy_object
  [   12d]  p11_kit_uri_set_module_name
  [   149]  p11_kit_registered_name_to_module
  [   16b]  p11_kit_pin_new
  [   17b]  p11_kit_iter_get_object
  [   193]  p11_kit_module_finalize
  [   1ab]  p11_kit_iter_free
  [   1bd]  p11_kit_uri_any_unrecognized
  [   1da]  p11_kit_remote_serve_token
  [   1f5]  p11_kit_uri_set_vendor_query
  [   212]  p11_kit_uri_match_module_info
  [   230]  p11_kit_iter_keep_session
  [   24a]  p11_kit_config_option
  [   260]  p11_kit_space_strlen
  [   275]  p11_kit_module_initialize
  [   28f]  p11_kit_uri_set_unrecognized
  [   2ac]  p11_kit_uri_clear_attribute
  [   2c8]  p11_kit_uri_free
  [   2d9]  p11_kit_initialize_registered
  [   2f7]  p11_kit_iter_set_uri
  [   30c]  p11_kit_uri_get_vendor_query
  [   329]  p11_kit_pin_register_callback
  [   347]  p11_kit_modules_initialize
  [   362]  p11_kit_uri_match_token_info
  [   37f]  p11_kit_iter_get_module
  [   397]  p11_kit_iter_get_slot_info
  [   3b2]  p11_kit_uri_new
  [   3c2]  p11_kit_uri_match_slot_info
  [   3de]  p11_kit_uri_get_slot_id
  [   3f6]  p11_kit_iter_begin
  [   409]  p11_kit_pin_file_callback
  [   423]  p11_kit_uri_set_pin_source
  [   43e]  p11_kit_finalize_registered
  [   45a]  p11_kit_initialize_module
  [   474]  p11_kit_pin_new_for_string
  [   48f]  p11_kit_iter_add_callback
  [   4a9]  p11_kit_iter_get_token
  [   4c0]  p11_kit_uri_set_attribute
  [   4da]  p11_kit_module_release
  [   4f1]  p11_kit_module_load
  [   505]  p11_kit_iter_get_session
  [   51e]  p11_kit_iter_add_filter
  [   536]  p11_kit_uri_get_module_path
  [   552]  p11_kit_iter_new
  [   563]  p11_kit_strerror
  [   574]  p11_kit_uri_get_slot_info
  [   58e]  p11_kit_iter_begin_with
  [   5a6]  p11_kit_set_progname
  [   5bb]  p11_kit_load_initialize_module
  [   5da]  p11_kit_uri_get_token_info
  [   5f5]  p11_kit_registered_option
  [   60f]  p11_kit_modules_finalize
  [   628]  p11_kit_iter_get_attributes
  [   644]  p11_kit_uri_match_attributes
  [   661]  p11_kit_module_get_filename
  [   67d]  p11_kit_iter_next
  [   68f]  p11_kit_module_get_name
  [   6a7]  p11_kit_uri_set_slot_id
  [   6bf]  C_GetFunctionList
  [   6d1]  p11_kit_pin_unref
  [   6e3]  p11_kit_modules_finalize_and_release
  [   708]  p11_kit_registered_modules
  [   723]  p11_kit_uri_parse
  [   735]  p11_kit_uri_get_module_info
  [   751]  p11_kit_remote_serve_module
  [   76d]  p11_kit_uri_message
  [   781]  p11_kit_be_loud
  [   791]  p11_kit_uri_get_pin_value
  [   7ab]  p11_kit_override_system_files
  [   7c9]  p11_kit_iter_load_attributes
  [   7e6]  p11_kit_iter_get_kind
  [   7fc]  p11_kit_remote_serve_tokens
  [   818]  p11_kit_module_get_flags
  [   831]  p11_kit_be_quiet
  [   842]  p11_kit_module_for_name
  [   85a]  p11_kit_iter_get_slot
  [   870]  p11_kit_uri_get_pin_source
  [   88b]  p11_kit_pin_new_for_buffer
  [   8a6]  p11_kit_message
  [   8b6]  p11_kit_uri_get_attributes
  [   8d1]  p11_kit_pin_unregister_callback
  [   8f1]  p11_kit_space_strdup
  [   906]  p11_kit_uri_format
  [   919]  p11_kit_modules_load_and_initialize
  [   93d]  p11_kit_uri_clear_attributes
  [   95a]  p11_kit_uri_set_attributes
  [   975]  p11_kit_uri_get_pinfile
  [   98d]  p11_kit_uri_get_module_name
  [   9a9]  p11_kit_pin_get_value

FWIW.
-- 
        Thierry Laronde <tlaronde +AT+ polynum +dot+ com>
                     http://www.kergis.com/
                       http://www.sbfa.fr/
Key fingerprint = 0FF7 E906 FBAF FE95 FD89  250D 52B1 AE95 6006 F40C


Home | Main Index | Thread Index | Old Index