[PATCH] D33251: [lld][ELF]Add option to make .dynamic read only

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Thu May 25 14:32:25 PDT 2017


Roland McGrath <mcgrathr at google.com> writes:

> I'm still not completely clear on what this suggestion is.
> As I said above, modifying an auxv entry itself does not fill the need.
> There's only one plan based on auxv I can think of that would work,
> so perhaps that is what Joerg actually meant:
>
> The kernel provides a new entry {AT_FOO, <addr>} where <addr> is the
> address of some word
> (presumably on the initial stack the kernel sets up, near where auxv
> itself is passed at startup).
> Then the dynamic linker can store &r_debug at *<addr>.
> Debuggers can find AT_FOO in /proc/$pid/auxv or NT_AUXV to discover <addr>.

Something like that could work.

In any case. I am OK with the patch adding the option for a read only
.dynamic that also disables DT_DEBUG.

I would also be OK with another solution for detecting when to produce a
read only .dynamic.

Cheers,
Rafael


More information about the llvm-commits mailing list