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 definitely not discarding unreferenced routines


Hi!

You might recall a few days ago that I posted with a problem regarding
discarding of unreferenced routines, I'm still seeing this happening. 

I'm using binutils 2.20.1 and NASM to build the boot block loaders. I
have taken what I've been working on and condensed them into a smaller
testcase. There are two binaries, part1.bin and part2.bin, one is a 16
bit boot loader whilst the other is a 32 bit protected mode boot loader.
Both reference routines held in a common library archive, created with
ar. 

In the common library archive (libcommon.a), there are two main
routines. One is 16 bit and the other is 32 bit. Linking part1.bin
should only pull in the 16 bit routine from the library, whilst linking
part2.bin should do the same for the 32 bit routine. 

Yet the linker is pulling in everything from the library archive, which
is the problem I've been experiencing with my project a few days ago
which makes the boot loader too big to fit into a 512 byte disk sector.
This can be seen in the map files generated. 

I have placed the testcase here at this URL:
http://www.munted.org.uk/programming/testcase.zip

I am not on the mailing list, so please take care to cc me when
replying. Thanks. 
-- 
http://www.munted.org.uk

One very high maintenance cat living here.


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