[PATCH] D14218: [ELF2] Implements -z relro: create an ELF "PT_GNU_RELRO" segment header in the object.

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Thu Nov 19 18:30:04 PST 2015


On 19 November 2015 at 16:26, George Rimar <grimar at accesssoftek.com> wrote:
> grimar added inline comments.
>
> ================
> Comment at: ELF/Writer.cpp:371
> @@ +370,3 @@
> +    return Config->ZNow;
> +  StringRef WhiteList[] = {".data.rel.ro", ".ctors", ".dtors",  ".jcr",
> +                           ".eh_frame",    ".got",   ".dynamic"};
> ----------------
> rafael wrote:
>> Check for &Dynamic and &Got instead of the names.
> I tried that and the above when developed it to see and that made method to look a bit more bulky. It adds one more _if_ section and for me comparing of names looks better since we anyways unable to get rid of that at all and dont plan to rename the sections ever.
> So do you think its really be better to do ?

Part of the ELF design is that names are not relevant. Unfortunately
that is not always the case, like the extension that adds meaning to
"rel.ro", but we should try to check names only when absolutely
necessary.

Cheers,
Rafael


More information about the llvm-commits mailing list