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

Rafael Avila de Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue May 23 17:16:49 PDT 2017


Rui Ueyama via Phabricator <reviews at reviews.llvm.org> writes:

> ruiu added a comment.
>
> I'm not convinced that we need this, so please don't submit.
>
> If this is for your OS's vDSO which needs to be read by an in-kernel ELF loader which doesn't support the entire ELF spec, this patch is to work around your loader's limitation. If you don't want to implement a complete ELF loader, why do you want to "fix" the problem in the right way? It is odd that you do hack at one place and do the right thing at the other place. Your loader can ignore RW bit and map .dynamic sections to read-only segments.


If I understand it correctly, the situation is

* .dynamic in current loaders is only RW because of DT_DEBUG.
* DT_DEBUG is considered a bit of a hack. If the dynamic linker wants to
  pass information to the debugger it can do something with aux vectors
  instead of writing to the loaded object.

Joerg, can you expand on the last point?

If my understanding is correct, I am sympathetic to an effort to make
.dynamic RO and not spread the MIPS way of doing it.

Cheers,
Rafael


More information about the llvm-commits mailing list