* 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>
* aclocal.m4: Regenerated.

View File

@ -3323,9 +3323,8 @@ assign_section_numbers (bfd *abfd, struct bfd_link_info *link_info)
case SHT_GNU_LIBLIST:
/* sh_link is the section header index of the prelink library
list
used for the dynamic entries, or the symbol table, or the
version strings. */
list used for the dynamic entries, or the symbol table, or
the version strings. */
s = bfd_get_section_by_name (abfd, (sec->flags & SEC_ALLOC)
? ".dynstr" : ".gnu.libstr");
if (s != NULL)
@ -4373,7 +4372,7 @@ assign_file_positions_for_load_sections (bfd *abfd,
else if (m->count == 0)
p->p_paddr = 0;
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
&& (abfd->flags & D_PAGED) != 0)
@ -5608,8 +5607,7 @@ rewrite_elf_program_header (bfd *ibfd, bfd *obfd)
if (IS_CONTAINED_BY_LMA (output_section, segment, map->p_paddr)
|| IS_COREFILE_NOTE (segment, section)
|| (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)
matching_lma = output_section->lma;
@ -8002,7 +8000,6 @@ elfcore_netbsd_get_lwpid (Elf_Internal_Note *note, int *lwpidp)
static bfd_boolean
elfcore_grok_netbsd_procinfo (bfd *abfd, Elf_Internal_Note *note)
{
/* Signal number at offset 0x08. */
elf_tdata (abfd)->core_signal
= bfd_h_get_32 (abfd, (bfd_byte *) note->descdata + 0x08);