]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
Don't create .eh_frame_hdr on shared lib bfd
authorAlan Modra <amodra@gmail.com>
Wed, 24 Dec 2014 11:37:42 +0000 (22:07 +1030)
committerAdhemerval Zanella <adhemerval.zanella@linaro.org>
Thu, 24 Aug 2017 12:46:41 +0000 (09:46 -0300)
commit27a04a5d7a620a7d066a3a150f2e93d68da371a0
tree30a7cfa02d69dccc5b407e51bf8eb4bf5f8d918f
parentba843cfe03df18d4aad90e51832641966471ed41
Don't create .eh_frame_hdr on shared lib bfd

If no object files have .eh_frame, but some shared library does, then
ld creates a .eh_frame_hdr section using the shared library bfd.  This
is silly since shared library .eh_frame sections don't contribute to
the output .eh_frame and thus no .eh_frame_hdr is needed.

Also, the bfd section list and count is cleared for shared libraries,
and a zero section count used as a flag in lang_check to omit a call
to bfd_merge_private_bfd_data for shared libraries.  If we create a
section on a shared lib bfd then ld will wrongly attempt to merge the
shared library private bfd data.

PR 17742
* ld/emultempl/elf32.em (gld${EMULATION_NAME}_after_open): Exclude
shared libraries in loop looking for .eh_frame sections.
Similarly for build-id loop.
ld/ChangeLog
ld/emultempl/elf32.em