Created attachment 6146 [details]
Objects, Sources, Makefile
We are trying to use 'partial linking' to reduce the size of the resulting
binary. But it seems that the
object file produced by the partial link step is somehow corrupted. The AIX
linker complains with
ld: 0711-547 SEVERE ERROR: Object partial.o cannot be processed.
RLD address 0x10000364 for section 2 (.data) is
not contained in the section.
collect2: ld returned 12 exit status
Source files:
sandbox@rs6k> cat main.cpp
int main() {
return 0;
}
sandbox@rs6k> cat foo.cpp
#include<memory>
void foo() {
std::auto_ptr<int> p1(new int);
}
sandbox@rs6k> cat bar.cpp
#include<memory>
void bar() {
std::auto_ptr<int> p1(new int);
}
build steps:
g++ -fPIC -o foo.o -c foo.cpp
g++ -fPIC -o bar.o -c bar.cpp
# now the partial link step ...
gnu-ld -r -o partial.o foo.o bar.o
g++ -c -o main.o main.cpp
# now the final link step fails ...
g++ -o demo main.o partial.o
# ... fails with an error message from the AIX linker:
ld: 0711-547 SEVERE ERROR: Object partial.o cannot be processed.
RLD address 0x10000364 for section 2 (.data) is
not contained in the section.
collect2: ld returned 12 exit status
version information:
g++ --version
g++ (GCC) 4.5.3
gnu-ld --version
GNU ld (GNU Binutils) 2.22.51.20111212
AIX Linker: ld -V
ld: LD 1.65.2.6 (2/24/09)
AIX OS: oslevel -s
5300-03-CSP-0000