[PATCH] D13950: ELF2: Implement --gc-sections.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Oct 21 15:36:46 PDT 2015


>> Can you check anything other than the name? The section type or flags maybe?
> This list may be limited but I don't know what other sections need to be preserved.

I don't mean to preserve less sections. Just how we check them. Of your list:

* .ctors, .dtors: I think we have to use the name.
* .fini: Check SHT_INIT_ARRAY
* .init: Check SHT_FINI_ARRAY
* .note: Check SHT_NOTE

You also need a check for   SHT_PREINIT_ARRAY.

> Externally visible symbols might be used later at runtime to interpose symbols provided by DSOs, no?

You can't interpose if it is already in the main binary, and if a
shared library wants symbols from the binary, the binary must be
linked with --export-dynamic.

Cheers,
Rafael


More information about the llvm-commits mailing list