bug-gnu-utils
[Top][All Lists]
Advanced

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

ld BFD internal error linking mips-linux code


From: Chris Bainbridge
Subject: ld BFD internal error linking mips-linux code
Date: Sun, 9 Jun 2002 13:54:04 +0100

I have built a cross compiler for mips-linux (mips-elf) using the commands 
below. When I  try to link a simple C test program I get the following error:

mips-linux-ld  -T test.ld
mips-linux-ld: BFD 2.12 internal error, aborting at ../../bfd/elf32-mips.c 
line 1908 in _bfd_mips_elf_got16_reloc

mips-linux-ld: Please report this bug.

This is with binutils 2.12, gcc 3.1 or 2.95.3, and newlib 1.10.0. The build 
host is 
redhat 7.3 x86 linux with gcc 2.96 and binutils 2.11.93. I have tried 
building earlier versions of both binutils and gcc but still get the same 
error. The commands used are:

build binutils:

export VERSION=2.12
./configure --target=$TARGET --prefix=/usr/local/
make prefix=/usr/local/stow/binutils-$TARGET-$VERSION install

build gcc:

export VERSION=3.1
export TARGET=mips-linux
./configure --target=$TARGET --prefix=/usr/local/ --enable-languages=c   
--disable-shared  --program-prefix=$TARGET- --with-gnu-as --with-gnu-ld 
--with-as=/usr/local/bin/$TARGET-as --with-ar=/usr/local/bin/$TARGET-ar 
--with-ld=/usr/local/bin/$TARGET-ld --with-nm=/usr/local/bin/$TARGET-nm 
--with-objdump=/usr/local/bin/$TARGET-objdump  --disable-nls 
--enable-checking=no --without-headers --with-newlib
make
make prefix=/usr/local/stow/gcc-$TARGET-$VERSION install

build newlib:

export VERSION=1.10.0
export TARGET=mips-linux
./configure --target=$TARGET --prefix=/usr/local/
make
make prefix=/usr/local/stow/newlib-$VERSION install

contents of test.c:

int main()
{
  int a,b,c;
  a=5;
  b=6;
  c=a+b;
  return c;
}

contents of Makefile:

all:
        mips-linux-gcc -Wall -mips3 -O1 -mno-abicalls -EB -fno-pic -c test.c
        mips-linux-ld  -T test.ld

contents of test.ld:

ENTRY(_start)
OUTPUT_FORMAT(binary)

SEARCH_DIR("/usr/local/lib/gcc-lib/mips-linux/3.1/")
SEARCH_DIR("/usr/local/mips-linux/lib")
SEARCH_DIR(".")
STARTUP("crt0.o")
GROUP(-lgcc -lc -lg)

MEMORY
{
        k0      :       ORIGIN = 0x80000000, LENGTH =  8M
}

SECTIONS {

text : {
        _start_text = .;
        *(.text)
        _end_text = .;
} > k0

data : {
        . = ALIGN(8);
        *(.reginfo)
        . = ALIGN(8);
        _start_data = .;
        /* read only data */
        *(.rodata)
        /* normal data */
        *(.data)
        _end_data = .;
} > k0

 = ALIGN(8);
_gp = . + 0x8000;

sdata : {
        *(.scommon)
        *(.sdata)
        *(.lit4)
        *(.lit8)
} > k0

 = ALIGN(4);
bss : {
        _bss_start = .;
        _fbss = .;
        *(.sbss)
        *(.bss)
        *(COMMON)
        _bss_end = .;
} > k0

_end = ALIGN(8);



reply via email to

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