This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: Bogus p_memsz for multiple BSS segments
- From: Andreas Schwab <schwab at suse dot de>
- To: binutils at sourceware dot org
- Cc: richard at codesourcery dot com
- Date: Thu, 10 May 2007 13:08:14 +0200
- Subject: Re: Bogus p_memsz for multiple BSS segments
- References: <871whpc5aw.fsf@firetop.home>
Richard Sandiford <richard@codesourcery.com> writes:
> assign_file_positions_for_load_sections uses:
>
> if (p->p_type == PT_LOAD
> || p->p_type == PT_TLS)
> {
> bfd_signed_vma adjust = sec->lma - (p->p_paddr + p->p_filesz);
>
> to calculate the difference between the current end of a segment and the
> load address of its next section. This calculation was originally just
> associated with SEC_LOAD sections (where it's correct), but it is now
> used for BSS sections too. This leads to quadratic explosion of p_memsz
> when there are multiple bss sections. (E.g., the data segment in the
> attached testcase would have a p_memsz of 0xca80000 rather than the
> expected 0x500000.)
Looks like the same bug as
<http://sourceware.org/bugzilla/show_bug.cgi?id=4479>.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
PGP key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."