Place $(elf-objpfx)sofini.os the last [BZ #22051]
Commit Message
Since sofini.os terminates .eh_frame section, it should be placed the
last.
Tested on x86-64. OK for master?
H.J.
---
[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.
---
Makerules | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
Comments
On Aug 31 2017, "H.J. Lu" <hjl.tools@gmail.com> wrote:
> +# sofini.os must be the last since it terminates .eh_frame section.
s/the// || s/the/placed/
Andreas.
@@ -686,14 +686,17 @@ $(build-module-helper) -o $@ $(shlib-lds-flags) \
$(call after-link,$@)
endef
+# sofini.os must be the 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