This is the mail archive of the
mailing list for the binutils project.
RE: [RFC][MIPS] What to do about DT_MIPS_RLD_MAP and PIE
- From: Roland McGrath <roland at hack dot frob dot com>
- To: Matthew Fortune <Matthew dot Fortune at imgtec dot com>
- Cc: "Maciej W. Rozycki" <macro at codesourcery dot com>, "binutils at sourceware dot org" <binutils at sourceware dot org>, "libc-alpha at sourceware dot org" <libc-alpha at sourceware dot org>, "Joseph Myers (joseph at codesourcery dot com)" <joseph at codesourcery dot com>, Richard Sandiford <rdsandiford at googlemail dot com>, "Moore, Catherine (Catherine_Moore at mentor dot com)" <Catherine_Moore at mentor dot com>, Nikola Veljkovic <Nikola dot Veljkovic at imgtec dot com>
- Date: Wed, 22 Oct 2014 13:02:29 -0700 (PDT)
- Subject: RE: [RFC][MIPS] What to do about DT_MIPS_RLD_MAP and PIE
- Authentication-results: sourceware.org; auth=none
- References: <6D39441BF12EF246A7ABCE6654B0235320F3027E at LEMAIL01 dot le dot imgtec dot org> <alpine dot DEB dot 1 dot 10 dot 1410221755430 dot 7896 at tp dot orcam dot me dot uk> <6D39441BF12EF246A7ABCE6654B0235320F30462 at LEMAIL01 dot le dot imgtec dot org>
> I'm a bit stumped as to what the technical benefit was/is about having a read
> only dynamic section. Does anyone know?
The inverse question is more interesting. That is, why do other machines
have a writable .dynamic section? The only actually useful aspect of that
I'm aware of is DT_DEBUG. For all the others, it's just tradition to
update the values in place with the load-base adjustment. The main
downside is consuming space on a data page that will get COW, which in some
binaries will tip the balance so one additional page gets COW than would
have if .dynamic were in the read-only segment.
I don't know why the original design (by AT&T in SVR4, where ELF was
invented) used a writable section. I have always presumed that most
machines followed that example just to be similar to the earliest machines,
which did it that way; and that MIPS decided to diverge because read-only
just made more sense from first principles.