[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
gold and shared objects with gcc 4.1.2
From: |
Roland Baumann |
Subject: |
gold and shared objects with gcc 4.1.2 |
Date: |
Wed, 14 Jan 2009 09:48:35 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (X11/20081209) |
Hi,
I have a problem with gcc 4.1.2 and the gold linker (from binutils
2.19). We build shared objects with options "-s" and "-shared" together.
This leads to assertions in the gold linker. In most cases I
see
.../gold/real-ld: internal error in get_output_view, at
...src/binutils-2.19/gold/output.h:3081
collect2: ld returned 1 exit status
But for the very simple example provided below, I see a different assertion:
.../gold/real-ld: internal error in write_local_symbols, at
.../src/binutils-2.19/gold/object.cc:1471
collect2: ld returned 1 exit status
The example to trigger this error is:
----------------------------------------------
#include <iostream>
void print() {
std::cout << "Hello World!" << std::endl;
}
----------------------------------------------
I compile this with:
> g++-4.1.2 -c test_shared.cc -o test_shared.o
> g++-4.1.2 -B <path_to_gold> -shared -s test_shared.o -o test_shared.so
If I do the link with gcc 3.4.4 + gold (with the gcc 4.1.2 compiled
object file) the error does not occur! So I am really wondering what
goes on.
The ld linker also works with gcc 4.1.2. I can also do the linking with
gcc 4.1.2 + gold if I omit the "-s" option.
Any help appreciated.
Thanks,
Roland
- gold and shared objects with gcc 4.1.2,
Roland Baumann <=