[ot]? problem with ld

From: K (k_at_mail.net)
Date: 02/19/04

  • Next message: K: "[ot]? problem with ld"
    Date: Thu, 19 Feb 2004 11:42:11 +0100
    
    

    Hi, I'm trying to link a program in FreeBSD, but I get the following
    error: /usr/libexec/elf/ld: final link failed: File too large

    As the text shows, the disk is filled with the binary generated, so
    it seems that ld gets confused with the link script provided:

    --
    paddr = 0x00100000;
    vaddr = 0x80000000;
    entry = start - vaddr + paddr;
    OUTPUT_FORMAT("elf32-i386")
    OUTPUT_ARCH(i386)
    ENTRY (entry)
    PHDRS
    {
        code PT_LOAD;
        data PT_LOAD;
        bss PT_LOAD;
    }
    SECTIONS
    {
        .text vaddr + SIZEOF_HEADERS : AT(paddr + SIZEOF_HEADERS)
        {
            *(.text)
            *(.rodata)
        } : code = 0x90909090
        . = ALIGN(0x1000) + (. & (0x1000 - 1));
        .data : AT( ADDR(.data) - vaddr + paddr)
        {
            *(.data)
        } : data
        .bss : AT( ADDR(.bss) - vaddr + paddr)
        {
            *(.bss)
            *(COMMON)
        } : bss
    }
    --
    I'm using FBSD 4.8 with ld v2.12.1
    The thing is that linking this in Linux (RH9) works
    *perfectly*, using ld 2.13.90.0.18
    So where is the problem? Why does FBSD's ld screams?
    Is there some compatibility issue among versions of ld?
    Thanks for any help.
    

  • Next message: K: "[ot]? problem with ld"

    Relevant Pages

    • [ot]? problem with ld
      ... entry = start - vaddr + paddr; ... ENTRY ... bss PT_LOAD; ...
      (comp.os.linux.development.system)
    • Linker problem in FreeBSD 4.8
      ... entry = start - vaddr + paddr; ... ENTRY ... bss PT_LOAD; ...
      (comp.unix.bsd.freebsd.misc)
    • Re: [PATCH 1/2] No-exec support for ppc64
      ... > I believe the problem is that the last PT_LOAD entry does not have the ... > .bss do not get mmapped with the section. ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)