aboutsummaryrefslogtreecommitdiff
path: root/bfd/elfcode.h
diff options
context:
space:
mode:
authorH.J. Lu <hjl.tools@gmail.com>2007-12-24 16:55:39 +0000
committerH.J. Lu <hjl.tools@gmail.com>2007-12-24 16:55:39 +0000
commit147d51c2327f0f36ddab7e2766087a902f8d83c1 (patch)
treef336d7d660e7da2e09b28179f134e0ce1ef90a73 /bfd/elfcode.h
parent5a517ebd81c05da8cf39fd9a9b8dddb4042009f6 (diff)
downloadgdb-147d51c2327f0f36ddab7e2766087a902f8d83c1.zip
gdb-147d51c2327f0f36ddab7e2766087a902f8d83c1.tar.gz
gdb-147d51c2327f0f36ddab7e2766087a902f8d83c1.tar.bz2
2007-12-24 H.J. Lu <hongjiu.lu@intel.com>
PR binutils/5449 * elf.c (rewrite_elf_program_header): Don't adjust p_paddr if p_paddr is set to 0. (copy_private_bfd_data): Call rewrite_elf_program_header if p_paddr is set to 0. * elfcode.h (elf_swap_phdr_out): Set p_paddr to 0 if needed. * elfxx-ia64.c (ELF_MAXPAGESIZE): Don't redefine it for HPUX.
Diffstat (limited to 'bfd/elfcode.h')
-rw-r--r--bfd/elfcode.h8
1 files changed, 7 insertions, 1 deletions
diff --git a/bfd/elfcode.h b/bfd/elfcode.h
index ea2a6d3..969c25a 100644
--- a/bfd/elfcode.h
+++ b/bfd/elfcode.h
@@ -370,11 +370,17 @@ elf_swap_phdr_out (bfd *abfd,
const Elf_Internal_Phdr *src,
Elf_External_Phdr *dst)
{
+ const struct elf_backend_data *bed;
+ bfd_vma p_paddr;
+
+ bed = get_elf_backend_data (abfd);
+ p_paddr = bed->want_p_paddr_set_to_zero ? 0 : src->p_paddr;
+
/* note that all elements of dst are *arrays of unsigned char* already... */
H_PUT_32 (abfd, src->p_type, dst->p_type);
H_PUT_WORD (abfd, src->p_offset, dst->p_offset);
H_PUT_WORD (abfd, src->p_vaddr, dst->p_vaddr);
- H_PUT_WORD (abfd, src->p_paddr, dst->p_paddr);
+ H_PUT_WORD (abfd, p_paddr, dst->p_paddr);
H_PUT_WORD (abfd, src->p_filesz, dst->p_filesz);
H_PUT_WORD (abfd, src->p_memsz, dst->p_memsz);
H_PUT_32 (abfd, src->p_flags, dst->p_flags);