This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
ld and .a file question
- From: Lal <learner dot kernel at gmail dot com>
- To: binutils at sourceware dot org
- Date: Sat, 29 May 2010 16:51:11 +0900
- Subject: ld and .a file question
Why ld does not extract symbols from archived file in below example?
-bash-3.00$
-bash-3.00$ gcc -c test.c
-bash-3.00$ nm test.o
00000018 T fun1
00000000 T func2
0000002a T main
U printf
-bash-3.00$ ld -r test.o -o test1.o
-bash-3.00$ nm test1.o
00000018 T fun1
00000000 T func2
0000002a T main
U printf
-bash-3.00$
-bash-3.00$
-bash-3.00$ ar rvf lib.a test.o
r - test.o
-bash-3.00$ nm lib.a
test.o:
00000018 T fun1
00000000 T func2
0000002a T main
U printf
-bash-3.00$
-bash-3.00$ ld -r lib.a -o test1.o
-bash-3.00$ nm test1.o
-bash-3.00$
I expected test1.o (in 2nd iteration) to have the symbols, but it does not!
Regards
Lal