This is the mail archive of the
binutils@sources.redhat.com
mailing list for the binutils project.
Re: Shared library size anomaly
- From: Andreas Schwab <schwab at suse dot de>
- To: Bryce McKinlay <bryce at mckinlay dot net dot nz>
- Cc: binutils at sources dot redhat dot com
- Date: Thu, 25 Sep 2003 11:55:39 +0200
- Subject: Re: Shared library size anomaly
- References: <18CDF9FD-EF39-11D7-8F24-003065F97F7C@mckinlay.net.nz>
Bryce McKinlay <bryce@mckinlay.net.nz> writes:
> Here's something weird that I noticed while messing around with the merge
> patch. A libgcj.so created by:
>
> $ ld -r -o temp.o (all object files...)
> $ gcj --shared temp.o -o libgcj.so
>
> is some 400K smaller than one created with:
>
> $ gcj --shared -o libgcj.so (all object files...)
>
> Each of the libraries works fine. Examining with objdump revealed that
> almost all the sections had slightly different sizes, however .rodata
> seems to be accounting for most of the discrepancy:
>
> - 11 .rodata 000a0599 005c6440 005c6440 005c6440 2**5
> + 11 .rodata 000f776b 005ca1e0 005ca1e0 005ca1e0 2**5
> CONTENTS, ALLOC, LOAD, READONLY, DATA
>
> Any clues what would cause this? Could this be a constant merging bug?
Try examining the linker map (generated by passing -Map=file to the
linker).
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux AG, Deutschherrnstr. 15-19, D-90429 Nürnberg
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."