[PATCH] D35487: [ELF] - Represent .init_array/.fini_array via synthetic sections.

Orivej Desh via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jul 18 02:44:09 PDT 2017


orivej added a comment.

> It should be possible to implement this, but I do not think that is what bfd do when mixing them. So why LLD should?

I do not know how bfd interprets this script, but its test checks that they are mixed: https://sourceware.org/git/?p=binutils-gdb.git;a=blob;f=ld/testsuite/ld-elf/init-mixed.c;h=f401ded4d702be49669ecdc7893f65cc70e9fa7c;hb=HEAD
The need to mix .ctors with .init_array is the reason why gcc could not just add support for .init_array in crtbegin.o and had to change the linker.

> Probably it worth to push it on review to phab then.

@ruiu has proposed another approach: https://bugs.llvm.org/show_bug.cgi?id=31224#c26, https://reviews.llvm.org/D35509


https://reviews.llvm.org/D35487





More information about the llvm-commits mailing list