]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Place $(elf-objpfx)sofini.os last [BZ #22051]
authorH.J. Lu <hjl.tools@gmail.com>
Thu, 31 Aug 2017 13:28:31 +0000 (06:28 -0700)
committerH.J. Lu <hjl.tools@gmail.com>
Thu, 7 Sep 2017 16:19:33 +0000 (09:19 -0700)
Since sofini.os terminates .eh_frame section, it should be placed last.

[BZ #22051]
* Makerules (build-module-helper-objlist): Filter out
$(elf-objpfx)sofini.os.
(build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is
needed.

(cherry picked from commit ecd0747df388f3925d4839740b0abcf43d0a9fb2)

ChangeLog
Makerules

index 13415f91636fc9a14111aecdf989f48754db3769..c48bdb62652dcfa33964a52c098e033181fdec18 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2017-08-31  H.J. Lu  <hongjiu.lu@intel.com>
+
+       [BZ #22051]
+       * Makerules (build-module-helper-objlist): Filter out
+       $(elf-objpfx)sofini.os.
+       (build-shlib-objlist): Append $(elf-objpfx)sofini.os if it is
+       needed.
+
 2017-07-29  Torvald Riegel  <triegel@redhat.com>
            Carlos O'Donell  <carlos@redhat.com>
 
index 7f0eef8096cc58793fe20b3860c353cb7b772638..7403305d30a2a08a8d7815e5e616ac1bc9bd9385 100644 (file)
--- a/Makerules
+++ b/Makerules
@@ -669,14 +669,17 @@ $(build-module-helper) -o $@ $(shlib-lds-flags) \
 $(call after-link,$@)
 endef
 
+# sofini.os must be placed last since it terminates .eh_frame section.
 build-module-helper-objlist = \
        $(patsubst %_pic.a,$(whole-archive) %_pic.a $(no-whole-archive),\
                   $(filter-out %.lds $(map-file) $(+preinit) $(+postinit) \
+                               $(elf-objpfx)sofini.os \
                                $(link-libc-deps),$^))
 
 build-module-objlist = $(build-module-helper-objlist) $(LDLIBS-$(@F:%.so=%).so)
 build-shlib-objlist = $(build-module-helper-objlist) \
-                     $(LDLIBS-$(@F:lib%.so=%).so)
+                     $(LDLIBS-$(@F:lib%.so=%).so) \
+                     $(filter $(elf-objpfx)sofini.os,$^)
 
 # Don't try to use -lc when making libc.so itself.
 # Also omits crti.o and crtn.o, which we do not want