bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug ld/2470] New: /opt/gnu64/bin/ld: main: Not enough room for program


From: danglin at gcc dot gnu dot org
Subject: [Bug ld/2470] New: /opt/gnu64/bin/ld: main: Not enough room for program headers (allocated 5, need 6)
Date: 20 Mar 2006 02:53:07 -0000

-bash-2.05b$ cat xxx.sh
 -E -u main -a archive -o main /usr/ccs/lib/pa20_64/crt0.o 
/lib/pa20_64/unix98.o 
/test/gnu/gcc-4.1/objdir/gcc/stage1/crtbeginT.o -L/test/gnu/gcc-4.1/objdir/gcc/
stage1 -L/opt/gnu64/gcc/gcc-4.1.0/lib/gcc/hppa64-hp-hpux11.11/4.1.0 -L/usr/ccs/
lib/pa20_64 -L/opt/langtools/lib/pa20_64 -L/opt/gnu64/gcc/gcc-4.1.0/lib/gcc/
hppa64-hp-hpux11.11/4.1.0/../../.. -L/lib/pa20_64 -L/usr/lib/pa20_64 main.o -v -
lgcc -lgcc_eh -lpthread -lc -a shared -ldld -a archive -lc -lgcc -lgcc_eh /usr/
lib/pa20_64/milli.a /test/gnu/gcc-4.1/objdir/gcc/stage1/crtend.o

-bash-2.05b$ /opt/gnu64/bin/ld `cat xxx.sh`
GNU ld version 2.16.91 20060318
/opt/gnu64/bin/ld: main: Not enough room for program headers (allocated 5, need 
6)
 Section to Segment mapping:
  Segment              Sections...
  00:           PHDR:
  01:         INTERP:  .interp
  02:           LOAD:  .interp .dynamic .hash .dynsym .dynstr .rela.data 
.rela.dlt .text .rodata .PARISC.unwind
  03:           LOAD:  .eh_frame .tbss
  04:           LOAD:  .init .fini .init_array .fini_array .ctors .dtors .jcr 
.data.rel.ro .data .opd .dlt .sdata .sbss .bss .PARISC.ansi.common.1 
.PARISC.ansi.common.2 .PARISC.ansi.common.3 .PARISC.ansi.common.4 
.PARISC.ansi.common.5 .PARISC.ansi.common.6 .PARISC.ansi.common.7
  05:        DYNAMIC:  .dynamic
/opt/gnu64/bin/ld: final link failed: Bad value
</ld: main: Not enough room for program headers (allocated 5, need 6)

-bash-2.05b$ cat main.c
main () {}

The above problem is triggered in any '-static' link with gcc:

gcc -static -o main main.c

'-static' used to work but I think the introduction of HP_TLS support has broken
static links because the archive version of libc introduces various objects
utilizing the .tbss section.

This is what we have for the program headers when the application is linked
with HP ld:

Program Headers:
  Type           Offset             VirtAddr           PhysAddr
                 FileSiz            MemSiz              Flags  Align
  PHDR           0x0000000000000040 0x4000000000000040 0x0000000000000000
                 0x0000000000000230 0x0000000000000230  R      8
  PARISC_UNWIND  0x000000000000e280 0x400000000000e280 0x0000000000000000
                 0x00000000000047a0 0x00000000000047a0  R      4
  INTERP         0x0000000000017f50 0x4000000000017f50 0x0000000000000000
                 0x0000000000000018 0x0000000000000018  R      1
      [Requesting program interpreter: /usr/lib/pa20_64/dld.sl]
  DYNAMIC        0x0000000000000270 0x4000000000000270 0x0000000000000000
                 0x00000000000001e0 0x00000000000001e0  R      8
  HP_TLS         0x000000000005f8c8 0x800000010000e580 0x0000000000000000
                 0x0000000000000000 0x0000000000000050  R      8
  LOAD           0x0000000000000000 0x4000000000000000 0x0000000000000000
                 0x0000000000058540 0x0000000000058540  R E    10
  LOAD           0x0000000000059000 0x8000000100000000 0x0000000000000000
                 0x00000000000068c8 0x000000000000e580  RW     20
  HP_FASTBIND    0x000000000005f8c8 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  R      1
  NOTE           0x000000000005f8c8 0x0000000000000000 0x0000000000000000
                 0x000000000001c638 0x0000000000000000  R      8
  HP_STACK       0x000000000007bf00 0x0000000000000000 0x0000000000000000
                 0x0000000000000000 0x0000000000000000  RW     0

 Section to Segment mapping:
  Segment Sections...
   00
   01     .PARISC.unwind
   02     .interp
   03     .dynamic
   04     .tbss
   05     .dynamic .dynsym .dynstr .hash .rela.dlt .rela.init .rela.init_array .
rela.fini .rela.fini_array .rela.data.rel.ro .rela.data .rela.sdata .rela.preini
t .PARISC.unwind .rodata .interp .dynhash .opd .text
   06     .data .ctors .dtors .init .init_array .fini .fini_array .eh_frame .jcr
 .data.rel.local .data.rel.ro .preinit .plt .dlt .sdata .sbss .bss
   07
   08     .note
   09

A hack to elf64_hppa_additional_program_headers to provide an additional
program header when .tbss is present allows the file to link.  However,
the dynamic loader rejects the executable.   The HP TLS support uses 
different flag bits, so it's not detected as such.  As can be seen above,
it also uses PT_HP_TLS as its program header type.

-- 
           Summary: /opt/gnu64/bin/ld: main: Not enough room for program
                    headers (allocated 5, need 6)
           Product: binutils
           Version: 2.17 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: danglin at gcc dot gnu dot org
                CC: bug-binutils at gnu dot org
 GCC build triplet: hppa64-hp-hpux11.11
  GCC host triplet: hppa64-hp-hpux11.11
GCC target triplet: hppa64-hp-hpux11.11


http://sourceware.org/bugzilla/show_bug.cgi?id=2470

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]