* elf.c (assign_file_positions_for_load_sections): Adjust lma
	by p_vaddr_offset.
This commit is contained in:
Alan Modra
2007-07-02 06:47:43 +00:00
parent 8d452c7870
commit 08a40648e5
2 changed files with 87 additions and 84 deletions

View File

@ -1,3 +1,9 @@
2007-07-02 Alan Modra <amodra@bigpond.net.au>
PR 4712
* elf.c (assign_file_positions_for_load_sections): Adjust lma
by p_vaddr_offset.
2007-06-30 H.J. Lu <hongjiu.lu@intel.com> 2007-06-30 H.J. Lu <hongjiu.lu@intel.com>
* aclocal.m4: Regenerated. * aclocal.m4: Regenerated.

View File

@ -3323,9 +3323,8 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
case SHT_GNU_LIBLIST: case SHT_GNU_LIBLIST:
/* sh_link is the section header index of the prelink library /* sh_link is the section header index of the prelink library
list list used for the dynamic entries, or the symbol table, or
used for the dynamic entries, or the symbol table, or the the version strings. */
version strings. */
s = bfd_get_section_by_name (abfd, (sec->flags & SEC_ALLOC) s = bfd_get_section_by_name (abfd, (sec->flags & SEC_ALLOC)
? ".dynstr" : ".gnu.libstr"); ? ".dynstr" : ".gnu.libstr");
if (s != NULL) if (s != NULL)
@ -4373,7 +4372,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
else if (m->count == 0) else if (m->count == 0)
p->p_paddr = 0; p->p_paddr = 0;
else else
p->p_paddr = m->sections[0]->lma; p->p_paddr = m->sections[0]->lma - m->p_vaddr_offset;
if (p->p_type == PT_LOAD if (p->p_type == PT_LOAD
&& (abfd->flags & D_PAGED) != 0) && (abfd->flags & D_PAGED) != 0)
@ -5116,7 +5115,7 @@ _bfd_elf_write_object_contents (bfd *abfd)
/* Write out the section header names. */ /* Write out the section header names. */
if (elf_shstrtab (abfd) != NULL if (elf_shstrtab (abfd) != NULL
&& (bfd_seek (abfd, elf_tdata (abfd)->shstrtab_hdr.sh_offset, SEEK_SET) != 0 && (bfd_seek (abfd, elf_tdata (abfd)->shstrtab_hdr.sh_offset, SEEK_SET) != 0
|| ! _bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd)))) || !_bfd_elf_strtab_emit (abfd, elf_shstrtab (abfd))))
return FALSE; return FALSE;
if (bed->elf_backend_final_write_processing) if (bed->elf_backend_final_write_processing)
@ -5608,8 +5607,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr) if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr)
|| IS_COREFILE_NOTE (segment, section) || IS_COREFILE_NOTE (segment, section)
|| (bed->want_p_paddr_set_to_zero && || (bed->want_p_paddr_set_to_zero &&
IS_CONTAINED_BY_VMA (output_section, segment)) IS_CONTAINED_BY_VMA (output_section, segment)))
)
{ {
if (matching_lma == 0) if (matching_lma == 0)
matching_lma = output_section->lma; matching_lma = output_section->lma;
@ -8002,7 +8000,6 @@ elfcore_netbsd_get_lwpid (Elf_Internal_Note *note, int *lwpidp)
static bfd_boolean static bfd_boolean
elfcore_grok_netbsd_procinfo (bfd *abfd, Elf_Internal_Note *note) elfcore_grok_netbsd_procinfo (bfd *abfd, Elf_Internal_Note *note)
{ {
/* Signal number at offset 0x08. */ /* Signal number at offset 0x08. */
elf_tdata (abfd)->core_signal elf_tdata (abfd)->core_signal
= bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x08); = bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x08);