This is the mail archive of the libc-hacker@sourceware.org mailing list for the glibc project.

Note that libc-hacker is a closed list. You may look at the archives of this list, but subscription and posting are not open.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: check-textrel


On Wed, Mar 01, 2006 at 08:12:00PM -0800, David S. Miller wrote:
> 
> I just noticed the elf/check-textrel test is failing on
> sparc.  It complains because the third segment of all the
> shared objects are writable and executable.
> 
> This turns out to be the .tdata section.
> 
>     LOAD off    0x0014e478 vaddr 0x0015e478 paddr 0x0015e478 align 2**16
>          filesz 0x00004984 memsz 0x00007268 flags rwx
>  ...
>  17 .tdata        00000008  0015e478  0015e478  0014e478  2**2
>                   CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL
> 
> Probably some binutils issue?

Actually, SPARC ABI issue.  On i?86/x86_64/etc., there is
a separate .got.plt section (writable, non-executable) and .plt
section (non-writable, executable), on ppc32 there used to be
the same thing as on SPARC, i.e. .plt is both writable and executable,
ld.so changes instructions in .plt rather than some pointer that
.plt insns use, but now we have -msecure-plt alternative
which is also W^X.
Ulrich added the W^X test to elf/check-textrel for security reasons,
but I guess we just should have a whitelist of architectures that
are known with their ABI to be !(W^X).  sparc/sparc64/(ppc32 if not
using -msecure-plt)/alpha/ at least.
i?86/x86_64/ppc64/s390/s390x/arm/cris/sh are ok.

	Jakub


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]