[PATCH] D31255: Force @{init, fini}_array if section name starts with ".{init, fini}_array.".

Rui Ueyama via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Wed Mar 22 15:45:54 PDT 2017


ruiu added inline comments.


================
Comment at: lld/ELF/InputSection.cpp:78
+// result, the following assembler directive creates ".init_array.100"
+// with SHT_PROGBITS, while it should be SHF_INIT_ARRAY, for example.
+//
----------------
gsmolarczyk wrote:
> SHT_INIT_ARRAY
Fixed.


================
Comment at: lld/ELF/InputSection.cpp:88
+  if (Type == SHT_PROGBITS && Name.startswith(".fini_array."))
+    return SHT_FINI_ARRAY;
+  return Type;
----------------
gsmolarczyk wrote:
> How about folding if (Type == SHT_PROGBITS) into outer if instruction?
I originally did this that way, but I changed that as I think this new code is slightly easier to read.


https://reviews.llvm.org/D31255





More information about the llvm-commits mailing list