Rafael Avila de Espindola via llvm-dev
2017-May-23 22:19 UTC
[llvm-dev] [lld][ELF] Add option to make .dynamic read only
Petr Hosek via llvm-dev <llvm-dev at lists.llvm.org> writes:> One of the design principles we're trying to follow is to make everything > read-only, unless it has be writable. The only reason for .dynamic to be > writable is DT_DEBUG which is something we never intend to support. FWIW in > Fuchsia all we need is a read-only .dynamic without emitting DT_DEBUG > altogether, but we wanted to make sure that this flag is also usable > elsewhere hence implementing DT_DEBUG_INDIRECT which is already supported > by musl as Jake pointed out.It might be easier to have an option for making .dynamic be read only and the logic for emitting DT_DEBUG becomes ".dynamic is rw or mips". BTW, dynamic linkers really never relocate the .d_ptr entries? What are you guys using instead of DT_DEBUG? Cheers, Rafael
Petr Hosek via llvm-dev
2017-May-23 23:17 UTC
[llvm-dev] [lld][ELF] Add option to make .dynamic read only
On Tue, May 23, 2017 at 3:19 PM Rafael Avila de Espindola < rafael.espindola at gmail.com> wrote:> Petr Hosek via llvm-dev <llvm-dev at lists.llvm.org> writes: > > One of the design principles we're trying to follow is to make everything > > read-only, unless it has be writable. The only reason for .dynamic to be > > writable is DT_DEBUG which is something we never intend to support. FWIW > in > > Fuchsia all we need is a read-only .dynamic without emitting DT_DEBUG > > altogether, but we wanted to make sure that this flag is also usable > > elsewhere hence implementing DT_DEBUG_INDIRECT which is already supported > > by musl as Jake pointed out. > > It might be easier to have an option for making .dynamic be read only > and the logic for emitting DT_DEBUG becomes ".dynamic is rw or mips". > > BTW, dynamic linkers really never relocate the .d_ptr entries? >musl's dynamic linker doesn't and neither ours. Older versions of glibc's dynamic linker do, but I'm not sure about the newer ones.> What are you guys using instead of DT_DEBUG? >We use other OS-specific runtime means to register that address.> Cheers, > Rafael >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170523/40817b96/attachment.html>
Rui Ueyama via llvm-dev
2017-May-23 23:27 UTC
[llvm-dev] [lld][ELF] Add option to make .dynamic read only
On Tue, May 23, 2017 at 4:17 PM, Petr Hosek <phosek at chromium.org> wrote:> On Tue, May 23, 2017 at 3:19 PM Rafael Avila de Espindola < > rafael.espindola at gmail.com> wrote: > >> Petr Hosek via llvm-dev <llvm-dev at lists.llvm.org> writes: >> > One of the design principles we're trying to follow is to make >> everything >> > read-only, unless it has be writable. The only reason for .dynamic to be >> > writable is DT_DEBUG which is something we never intend to support. >> FWIW in >> > Fuchsia all we need is a read-only .dynamic without emitting DT_DEBUG >> > altogether, but we wanted to make sure that this flag is also usable >> > elsewhere hence implementing DT_DEBUG_INDIRECT which is already >> supported >> > by musl as Jake pointed out. >> >> It might be easier to have an option for making .dynamic be read only >> and the logic for emitting DT_DEBUG becomes ".dynamic is rw or mips". >> >> BTW, dynamic linkers really never relocate the .d_ptr entries? >> > > musl's dynamic linker doesn't and neither ours. Older versions of glibc's > dynamic linker do, but I'm not sure about the newer ones. > > >> What are you guys using instead of DT_DEBUG? >> > > We use other OS-specific runtime means to register that address. >Do the OS-specific means make sense for other OSes? -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170523/d4d95a2b/attachment.html>
Rafael Avila de Espindola via llvm-dev
2017-May-24 00:18 UTC
[llvm-dev] [lld][ELF] Add option to make .dynamic read only
Petr Hosek <phosek at chromium.org> writes:>> BTW, dynamic linkers really never relocate the .d_ptr entries? >> > > musl's dynamic linker doesn't and neither ours. Older versions of glibc's > dynamic linker do, but I'm not sure about the newer ones.Could you check what current glibc does by testing a simple program with your patch to make .dynamic ro? Cheers, Rafael