* elf.c (assign_file_positions_for_load_sections): Use p_memsz
	rather than p_filesz to calculate the LMA of the end of a segment.

ld/testsuite/
	* ld-elf/multibss1.d, ld-elf/multibss1.s: New test.
This commit is contained in:
Richard Sandiford
2007-05-10 14:46:48 +00:00
parent 1430be3e90
commit 8c252fd9c3
5 changed files with 30 additions and 1 deletions

View File

@@ -4520,7 +4520,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
if (p->p_type == PT_LOAD
|| p->p_type == PT_TLS)
{
bfd_signed_vma adjust = sec->lma - (p->p_paddr + p->p_filesz);
bfd_signed_vma adjust = sec->lma - (p->p_paddr + p->p_memsz);
if ((flags & SEC_LOAD) != 0
|| ((flags & SEC_ALLOC) != 0