When setting the base address to something else than 0x400000, ld will insert a
large (some 1MiB) hole right after the elf header. This is not directly a
problem, except if some third-party program (e.g. grub) relies on finding
secondary headers (e.g. the multiboot header) early in the file.

Example linker script:
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64",
          "elf64-x86-64")
OUTPUT_ARCH(i386:x86-64)
ENTRY(_start)
SECTIONS
{
  . = 0x100000 + SIZEOF_HEADERS;
  .text : { *(*) }
}

-- 
           Summary: Large, appareantly useless block of zeros inserted after
                    elf header
           Product: binutils
           Version: 2.17
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
        AssignedTo: unassigned at sources dot redhat dot com
        ReportedBy: e_mc_h2 at web dot de
                CC: bug-binutils at gnu dot org
 GCC build triplet: x86_64-unknown-linux-gnu
  GCC host triplet: x86_64-unknown-linux-gnu
GCC target triplet: x86_64-unknown-linux-gnu


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

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


_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to