summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Modra <amodra@bigpond.net.au>2008-10-20 10:50:37 +0000
committerAlan Modra <amodra@bigpond.net.au>2008-10-20 10:50:37 +0000
commit92c6110578ccb5264a694131455db18836f5e2d6 (patch)
treebd5c474a545e470391a4b08502bd7c5f3f241735
parentc86cea09963a4d569177a0557b422d923cdeb5fb (diff)
downloadbinutils-redhat-92c6110578ccb5264a694131455db18836f5e2d6.tar.gz
* elflink.c (bfd_elf_final_link): Use d_ptr rather than d_val
where Elf_Internal_Dyn holds an address.
-rw-r--r--bfd/ChangeLog5
-rw-r--r--bfd/elflink.c13
2 files changed, 12 insertions, 6 deletions
diff --git a/bfd/ChangeLog b/bfd/ChangeLog
index f0080bb344..9447166ea7 100644
--- a/bfd/ChangeLog
+++ b/bfd/ChangeLog
@@ -1,3 +1,8 @@
+2008-10-20 Alan Modra <amodra@bigpond.net.au>
+
+ * elflink.c (bfd_elf_final_link): Use d_ptr rather than d_val
+ where Elf_Internal_Dyn holds an address.
+
2008-10-10 Nathan Froyd <froydnj@codesourcery.com>
* elf32-ppc.c (ppc_elf_merge_obj_attributes): Merge
diff --git a/bfd/elflink.c b/bfd/elflink.c
index d2dc17d374..d39ec685f6 100644
--- a/bfd/elflink.c
+++ b/bfd/elflink.c
@@ -10756,16 +10756,16 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
&& (h->root.type == bfd_link_hash_defined
|| h->root.type == bfd_link_hash_defweak))
{
- dyn.d_un.d_val = h->root.u.def.value;
+ dyn.d_un.d_ptr = h->root.u.def.value;
o = h->root.u.def.section;
if (o->output_section != NULL)
- dyn.d_un.d_val += (o->output_section->vma
+ dyn.d_un.d_ptr += (o->output_section->vma
+ o->output_offset);
else
{
/* The symbol is imported from another shared
library and does not apply to this one. */
- dyn.d_un.d_val = 0;
+ dyn.d_un.d_ptr = 0;
}
break;
}
@@ -10844,6 +10844,7 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
else
type = SHT_RELA;
dyn.d_un.d_val = 0;
+ dyn.d_un.d_ptr = 0;
for (i = 1; i < elf_numsections (abfd); i++)
{
Elf_Internal_Shdr *hdr;
@@ -10856,9 +10857,9 @@ bfd_elf_final_link (bfd *abfd, struct bfd_link_info *info)
dyn.d_un.d_val += hdr->sh_size;
else
{
- if (dyn.d_un.d_val == 0
- || hdr->sh_addr < dyn.d_un.d_val)
- dyn.d_un.d_val = hdr->sh_addr;
+ if (dyn.d_un.d_ptr == 0
+ || hdr->sh_addr < dyn.d_un.d_ptr)
+ dyn.d_un.d_ptr = hdr->sh_addr;
}
}
}