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


From: Roland McGrath <roland@redhat.com>
Date: Wed,  1 Mar 2006 20:41:54 -0800 (PST)

> > 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?
> 
> That should be PT_TLS, not PT_LOAD.

Even with current binutils, it's still there, but then I noticed
this (this is for libc.so):

Program Header:
    PHDR off    0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2
         filesz 0x00000140 memsz 0x00000140 flags r-x
  INTERP off    0x00149428 vaddr 0x00149428 paddr 0x00149428 align 2**3
         filesz 0x00000018 memsz 0x00000018 flags r--
    LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**16
         filesz 0x0014e015 memsz 0x0014e015 flags r-x
    LOAD off    0x0014e478 vaddr 0x0015e478 paddr 0x0015e478 align 2**16
         filesz 0x00004984 memsz 0x00007268 flags rwx
 DYNAMIC off    0x0014ff18 vaddr 0x0015ff18 paddr 0x0015ff18 align 2**2
         filesz 0x000000e8 memsz 0x000000e8 flags rw-
    NOTE off    0x00000174 vaddr 0x00000174 paddr 0x00000174 align 2**2
         filesz 0x00000020 memsz 0x00000020 flags r--
     TLS off    0x0014e478 vaddr 0x0015e478 paddr 0x0015e478 align 2**2
         filesz 0x00000008 memsz 0x0000002c flags r--
EH_FRAME off    0x00149440 vaddr 0x00149440 paddr 0x00149440 align 2**2
         filesz 0x000010c4 memsz 0x000010c4 flags r--
   STACK off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**2
         filesz 0x00000000 memsz 0x00000000 flags rw-
   RELRO off    0x0014e478 vaddr 0x0015e478 paddr 0x0015e478 align 2**0
         filesz 0x00001b88 memsz 0x00001b88 flags r-x

Note the second LOAD and the one TLS are at the same location, same
off and vaddr, yet different alignment, different filesz and different
memsz.

RELRO is at the same offset too, again different filesz and memsz.

 17 .tdata        00000008  0015e478  0015e478  0014e478  2**2
                  CONTENTS, ALLOC, LOAD, DATA, THREAD_LOCAL
 18 .tbss         00000024  0015e480  0015e480  0014e480  2**2
                  ALLOC, THREAD_LOCAL
 19 .fini_array   00000004  0015e480  0015e480  0014e480  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 20 .ctors        0000000c  0015e484  0015e484  0014e484  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 21 .dtors        00000008  0015e490  0015e490  0014e490  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 22 __libc_subfreeres 00000054  0015e498  0015e498  0014e498  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 23 __libc_atexit 00000004  0015e4ec  0015e4ec  0014e4ec  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 24 __libc_thread_subfreeres 00000008  0015e4f0  0015e4f0  0014e4f0  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 25 .data.rel.ro  00001a20  0015e4f8  0015e4f8  0014e4f8  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 26 .dynamic      000000e8  0015ff18  0015ff18  0014ff18  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 27 .got          000023d8  00160000  00160000  00150000  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 28 .plt          00000124  001623d8  001623d8  001523d8  2**2
                  CONTENTS, ALLOC, LOAD, CODE
 29 .data         000008fc  00162500  00162500  00152500  2**3
                  CONTENTS, ALLOC, LOAD, DATA
 30 .bss          000028e0  00162e00  00162e00  00152dfc  2**3
                  ALLOC

Hmmm...

Part of the big LOAD segment is the .plt, which does need to be
executable and writable.


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