bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/14926] New: "Not enough room for program headers" error, even th


From: josh.m.conner at gmail dot com
Subject: [Bug ld/14926] New: "Not enough room for program headers" error, even though there is
Date: Thu, 06 Dec 2012 22:33:40 +0000

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

             Bug #: 14926
           Summary: "Not enough room for program headers" error, even
                    though there is
           Product: binutils
           Version: 2.23
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: address@hidden
        ReportedBy: address@hidden
    Classification: Unclassified


In the following example, I get an unwarranted error message:

$ cat test.s
    .file    "test.c"
    .text
    .p2align 4,,15
    .globl    _start
    .type    _start, @function
_start:
.LFB0:
    movl    $42, %eax
    ret
.LFE0:
    .size    _start, .-_start
$ as test.s -o test.o
$ ld test.o -o test -Ttext=0x60
ld: test: Not enough room for program headers, try linking with -N
ld: final link failed: Bad value
$

If I specify -Ttext=0x30 (or less) or -Ttext=0x80 (or greater), the link
happens as expected.

I'm reporting this because we've had a fix in our local tree for a while, and
it would be nice to get it into mainline.  The problem is that when we are
determining if the ELF and program headers can share the same segment as .text,
we only compare the address of .text against the size of the program headers --
we fail to take into account the size of the ELF header.

Specifically, in _bfd_elf_map_sections_to_segments (elf.c), the code following
this comment:

  /* Deal with -Ttext or something similar such that the first section
      ...

should add the ELF header size to the program header size when determining
whether the section needs to go into a new segment.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



reply via email to

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