This is the mail archive of the mailing list for the binutils project.

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] PR ld/19617: Always create dynamic sections for -E/--dynamic-list

On 17/02/16 22:41, H.J. Lu wrote:
> In embedded environments, including boot loaders, the non-PIC executable
> needs to export its symbols to modules loaded in the future.  We should
> always create dynamic sections for -E/--dynamic-list.
> Any comments?
> Thanks.
> H.J.
> --
> bfd/
> 	PR ld/19617
> 	* elflink.c (elf_link_add_object_symbols): Always create dynamic
> 	sections for -E/--dynamic-list.

since this commit;h=bf89386a862ace008f0152bca8bddf996d3993c8

static linking with --dynamic-list adds a nonsense
dynamic-loader to the executable e.g.

echo 'int main(){}' >a.c
echo '{main;};' >foo.list
gcc -static -Wl,--dynamic-list=foo.list a.c
readelf -l a.out |grep interpreter
      [Requesting program interpreter: /lib/]

i don't think --dynamic-list should imply dynamic section
(--export-dynamic is not specified) and even if there is
a dynamic section, why is there a loader? (static linked
binary may be able to relocate itself)

this broke static linking of gdb which always adds
--dynamic-list to the link command line.

i opened

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]