bug-binutils
[Top][All Lists]
Advanced

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

[Bug gold/10028] New: unnamed section in program headers


From: ratmice at gmail dot com
Subject: [Bug gold/10028] New: unnamed section in program headers
Date: 3 Apr 2009 03:46:59 -0000

#!/bin/sh
cat <<EOF >foo.c
int _start() {
 return 0; 
}
EOF

cat <<EOF >ldscript 
ENTRY(_start)

SECTIONS
{
  . = 0xC0000000 + 0x100000;
  _text = .;
}
EOF

gcc -Wl,-r -nostdlib foo.c -o foo.o

gcc -Wl,-Tldscript -nostdlib -o foo foo.o -g

readelf -l foo



this produces the output here of

Elf file type is EXEC (Executable file)
Entry point 0xc0100000
There are 3 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0xc00ff000 0xc00ff000 0x00094 0x00094 R   0x1000
  LOAD           0x001000 0xc0100000 0xc0100000 0x0000a 0x0000a R E 0x1000
  LOAD           0x00100c 0xc010000c 0xc010000c 0x00000 0x00000 RW  0x1000

 Section to Segment mapping:
  Segment Sections...
   00     
   01     .text 
   02   

when linking with gnu-ld these unnamed sections don't exist in the program 
headers,

when booting with grub, these sections appear to cause this error
[Multiboot-elf, <0xff000:0xb4:0x0>

Error 28: Selected item cannot fit into memory
this error is booting the actual coyotos kernel, where the unnamed section looks
like:
  LOAD           0x000000 0x00000000 0x000ff000 0x000b4 0x000b4 R   0x1000

the unnamed section doesn't appear when linking with gnu ld.
i am not really familiar with this stuff, so i'm not sure if the linker script
is relying on the behaviour of gnu ld, which is different in gold, or if this is
actually a bug.

let me know if you want the actual linker script as opposed to the reduction 
above.

-- 
           Summary: unnamed section in program headers
           Product: binutils
           Version: 2.20 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gold
        AssignedTo: ian at airs dot com
        ReportedBy: ratmice at gmail dot com
                CC: bug-binutils at gnu dot org


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

------- 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]