aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2017-08-31 06:28:31 -0700
committerH.J. Lu <hjl.tools@gmail.com>2017-08-31 06:28:46 -0700
commitecd0747df388f3925d4839740b0abcf43d0a9fb2 (patch)
tree669267082a28262d81f9ac0caf6022994b201d4f /Makerules
parentlibio: Assume _LIBC, weak_alias, errno, (__set_)errno &c are defined (diff)
downloadglibc-ecd0747df388f3925d4839740b0abcf43d0a9fb2.tar.gz
glibc-ecd0747df388f3925d4839740b0abcf43d0a9fb2.tar.bz2
glibc-ecd0747df388f3925d4839740b0abcf43d0a9fb2.zip
Place $(elf-objpfx)sofini.os last [BZ #22051]
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.
Diffstat (limited to 'Makerules')
-rw-r--r--Makerules5
1 files changed, 4 insertions, 1 deletions
diff --git a/Makerules b/Makerules
index 8f1324d8e9..bbfbefe33f 100644
--- a/Makerules
+++ b/Makerules
@@ -686,14 +686,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