This is the mail archive of the libc-alpha@sourceware.cygnus.com mailing list for the glibc project.


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

Re: [(nowhere)] libc/1808: ld.so on powerpc-redhat-linux-gnu with ld -Ttext ...


Roland McGrath wrote:
> 
> Something to note is that `objdump --private-headers' output (as well as
> `objdump -h') is really necessary in a report on this kind of thing.

Ok, appended below.

> I think that -Ttext is not the right option because that changes the load
> address of .text but not of all the other read-only sections that are
> expected to be contiguous with it.  I'm not sure off hand what the right
> option is (or if there is one), but you can rewrite the linker script instead.

Funnily, -Ttext works with anything I have tried between 0x1000000 and
0x8000000.

Also IMO -Ttext should be the right option.  If something else is
supposed to be contiguous with it, then the linker should move it
together with text; looking at the "objdump -h" output, it appears
that ld does this.  But of course this issue (if it is one) is for the
ld guys.

Ok, here's objdump -private-headers for a.out linkted with -Ttext
0x10000 (segfaults):

a.out:     file format elf32-powerpc

Program Header:
    PHDR off    0x00000034 vaddr 0x00010034 paddr 0x00000000 align 2**2
         filesz 0x000000e0 memsz 0x000000e0 flags r-x
  INTERP off    0x00020114 vaddr 0x10000114 paddr 0x10000114 align 2**0
         filesz 0x0000000d memsz 0x0000000d flags r--
    LOAD off    0x00010000 vaddr 0x00010000 paddr 0x00010000 align 2**16
         filesz 0x0000024c memsz 0x0000024c flags r-x
    LOAD off    0x00010250 vaddr 0x00020250 paddr 0x00020250 align 2**16
         filesz 0x000000e4 memsz 0x000001a0 flags rwx
    LOAD off    0x00020114 vaddr 0x10000114 paddr 0x10000114 align 2**16
         filesz 0x000001dc memsz 0x000001dc flags r--
 DYNAMIC off    0x00010274 vaddr 0x00020274 paddr 0x00020274 align 2**2
         filesz 0x000000a0 memsz 0x000000a0 flags rw-
    NOTE off    0x00020130 vaddr 0x10000130 paddr 0x10000130 align 2**4
         filesz 0x00000020 memsz 0x00000020 flags r--

Dynamic Section:
  NEEDED      libc.so.6
  INIT        0x101e0
  FINI        0x10208
  HASH        0x10000150
  STRTAB      0x10000204
  SYMTAB      0x10000184
  STRSZ       0x73
  SYMENT      0x10
  DEBUG       0x0
  PLTGOT      0x20334
  PLTRELSZ    0x3c
  PLTREL      0x7
  JMPREL      0x100002b4
  RELA        0x100002b4
  RELASZ      0x3c
  RELAENT     0xc
  VERNEED     0x10000294
  VERNEEDNUM  0x1
  VERSYM      0x10000282

Version References:
  required from libc.so.6:
    0x0d696910 0x00 02 GLIBC_2.0

And here's the private-headers for -Ttext 0x20000000 (which works):


a.out:     file format elf32-powerpc

Program Header:
    PHDR off    0x00000034 vaddr 0x10000034 paddr 0x10000034 align 2**2
         filesz 0x000000e0 memsz 0x000000e0 flags r-x
  INTERP off    0x00000114 vaddr 0x10000114 paddr 0x10000114 align 2**0
         filesz 0x0000000d memsz 0x0000000d flags r--
    LOAD off    0x00000000 vaddr 0x10000000 paddr 0x10000000 align 2**16
         filesz 0x000002f0 memsz 0x000002f0 flags r--
    LOAD off    0x00010000 vaddr 0x20000000 paddr 0x20000000 align 2**16
         filesz 0x0000024c memsz 0x0000024c flags r-x
    LOAD off    0x00010250 vaddr 0x20010250 paddr 0x20010250 align 2**16
         filesz 0x000000e4 memsz 0x000001a0 flags rwx
 DYNAMIC off    0x00010274 vaddr 0x20010274 paddr 0x20010274 align 2**2
         filesz 0x000000a0 memsz 0x000000a0 flags rw-
    NOTE off    0x00000130 vaddr 0x10000130 paddr 0x10000130 align 2**4
         filesz 0x00000020 memsz 0x00000020 flags r--

Dynamic Section:
  NEEDED      libc.so.6
  INIT        0x200001e0
  FINI        0x20000208
  HASH        0x10000150
  STRTAB      0x10000204
  SYMTAB      0x10000184
  STRSZ       0x73
  SYMENT      0x10
  DEBUG       0x0
  PLTGOT      0x20010334
  PLTRELSZ    0x3c
  PLTREL      0x7
  JMPREL      0x100002b4
  RELA        0x100002b4
  RELASZ      0x3c
  RELAENT     0xc
  VERNEED     0x10000294
  VERNEEDNUM  0x1
  VERSYM      0x10000282

Version References:
  required from libc.so.6:
    0x0d696910 0x00 02 GLIBC_2.0


Here's objdump -h for -Ttext 0x10000:

a.out:     file format elf32-powerpc

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000001e0  00010000  00010000  00010000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .interp       0000000d  10000114  10000114  00020114  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .note.ABI-tag 00000020  10000130  10000130  00020130  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .hash         00000034  10000150  10000150  00020150  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .dynsym       00000080  10000184  10000184  00020184  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .dynstr       0000007d  10000204  10000204  00020204  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version  00000010  10000282  10000282  00020282  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .gnu.version_r 00000020  10000294  10000294  00020294  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rela.plt     0000003c  100002b4  100002b4  000202b4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .init         00000028  000101e0  000101e0  000101e0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 10 .fini         00000020  00010208  00010208  00010208  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 .rodata       00000024  00010228  00010228  00010228  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 12 .sdata2       00000000  0001024c  0001024c  0001024c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 13 .data         00000020  00020250  00020250  00010250  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 14 .eh_frame     00000004  00020270  00020270  00010270  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 15 .dynamic      000000a0  00020274  00020274  00010274  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 16 .ctors        00000008  00020314  00020314  00010314  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 17 .dtors        00000008  0002031c  0002031c  0001031c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 18 .got          00000010  00020324  00020324  00010324  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 19 .sdata        00000000  00020334  00020334  00010334  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 20 .sbss         00000000  00020334  00020334  00010334  2**0
                  ALLOC
 21 .plt          00000084  00020334  00020334  00010334  2**2
                  ALLOC, CODE
 22 .bss          00000030  000203c0  000203c0  0001033c  2**2
                  ALLOC
 23 .stab         00000744  00000000  00000000  000202f0  2**2
                  CONTENTS, READONLY, DEBUGGING
 24 .stabstr      00001342  00000000  00000000  00020a34  2**0
                  CONTENTS, READONLY, DEBUGGING
 25 .comment      0000013e  000203f0  000203f0  00021d76  2**0
                  CONTENTS, READONLY

objdump -h for -Ttext 0x20000000:


a.out:     file format elf32-powerpc

Sections:
Idx Name          Size      VMA       LMA       File off  Algn
  0 .text         000001e0  20000000  20000000  00010000  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
  1 .interp       0000000d  10000114  10000114  00000114  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  2 .note.ABI-tag 00000020  10000130  10000130  00000130  2**4
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  3 .hash         00000034  10000150  10000150  00000150  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  4 .dynsym       00000080  10000184  10000184  00000184  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  5 .dynstr       0000007d  10000204  10000204  00000204  2**0
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  6 .gnu.version  00000010  10000282  10000282  00000282  2**1
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  7 .gnu.version_r 00000020  10000294  10000294  00000294  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  8 .rela.plt     0000003c  100002b4  100002b4  000002b4  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
  9 .init         00000028  200001e0  200001e0  000101e0  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 10 .fini         00000020  20000208  20000208  00010208  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, CODE
 11 .rodata       00000024  20000228  20000228  00010228  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 12 .sdata2       00000000  2000024c  2000024c  0001024c  2**2
                  CONTENTS, ALLOC, LOAD, READONLY, DATA
 13 .data         00000020  20010250  20010250  00010250  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 14 .eh_frame     00000004  20010270  20010270  00010270  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 15 .dynamic      000000a0  20010274  20010274  00010274  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 16 .ctors        00000008  20010314  20010314  00010314  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 17 .dtors        00000008  2001031c  2001031c  0001031c  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 18 .got          00000010  20010324  20010324  00010324  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 19 .sdata        00000000  20010334  20010334  00010334  2**2
                  CONTENTS, ALLOC, LOAD, DATA
 20 .sbss         00000000  20010334  20010334  00010334  2**0
                  ALLOC
 21 .plt          00000084  20010334  20010334  00010334  2**2
                  ALLOC, CODE
 22 .bss          00000030  200103c0  200103c0  0001033c  2**2
                  ALLOC
 23 .stab         00000744  00000000  00000000  0001033c  2**2
                  CONTENTS, READONLY, DEBUGGING
 24 .stabstr      00001342  00000000  00000000  00010a80  2**0
                  CONTENTS, READONLY, DEBUGGING
 25 .comment      0000013e  200103f0  200103f0  00011dc2  2**0
                  CONTENTS, READONLY

- anton

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