* 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

@ -1,3 +1,8 @@
2007-05-10 Richard Sandiford <richard@codesourcery.com>
* 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.
2007-05-10 Jakub Jelinek <jakub@redhat.com> 2007-05-10 Jakub Jelinek <jakub@redhat.com>
* elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc * elf64-ppc.c (ppc64_elf_adjust_dynamic_symbol): Don't do copyreloc

View File

@ -4520,7 +4520,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
if (p->p_type == PT_LOAD if (p->p_type == PT_LOAD
|| p->p_type == PT_TLS) || 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 if ((flags & SEC_LOAD) != 0
|| ((flags & SEC_ALLOC) != 0 || ((flags & SEC_ALLOC) != 0

View File

@ -1,3 +1,7 @@
2007-05-10 Richard Sandiford <richard@codesourcery.com>
* ld-elf/multibss1.d, ld-elf/multibss1.s: New test.
2007-04-27 Nathan Sidwell <nathan@codesourcery.com> 2007-04-27 Nathan Sidwell <nathan@codesourcery.com>
* ld-m68k/plt1-isac.d: New. * ld-m68k/plt1-isac.d: New.

View File

@ -0,0 +1,9 @@
#source: multibss1.s
#ld: -e 0
#readelf: -l --wide
#target: *-*-linux*
#...
+LOAD +0x[^ ]+ +0x[^ ]+ +0x[^ ]+ +0x[^ ]+ +0x500000 .*
# p_offset p_vaddr p_paddr p_filesz
#pass

View File

@ -0,0 +1,11 @@
.macro makebss
.section .bss_\@,"aw",@nobits
.space 0x10000
.endm
.rept 80
makebss
.endr
.text
.space 0x10