This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]