aboutsummaryrefslogtreecommitdiff
path: root/bfd/elflink.h
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>2000-05-18 17:12:31 +0000
committerNick Clifton <nickc@redhat.com>2000-05-18 17:12:31 +0000
commit7ad34365726a22e728f4508049ac3ac9c63401c6 (patch)
treefd06f150fd2022e0ae649117882bd9544c3ac478 /bfd/elflink.h
parent16ee897daa2d38e5cd63ba615d9856c4de9312b6 (diff)
downloadfsf-binutils-gdb-7ad34365726a22e728f4508049ac3ac9c63401c6.zip
fsf-binutils-gdb-7ad34365726a22e728f4508049ac3ac9c63401c6.tar.gz
fsf-binutils-gdb-7ad34365726a22e728f4508049ac3ac9c63401c6.tar.bz2
Force relocs emited for an executable to contain virtual addresses.
Diffstat (limited to 'bfd/elflink.h')
-rw-r--r--bfd/elflink.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/bfd/elflink.h b/bfd/elflink.h
index 749d139..5d86bbc 100644
--- a/bfd/elflink.h
+++ b/bfd/elflink.h
@@ -4323,7 +4323,7 @@ elf_bfd_final_link (abfd, info)
if (o != NULL)
o->target_index = bfd_get_symcount (abfd);
elfsym.st_shndx = i;
- if (info->relocateable || info->emitrelocations || o == NULL)
+ if (info->relocateable || o == NULL)
elfsym.st_value = 0;
else
elfsym.st_value = o->vma;
@@ -5514,6 +5514,10 @@ elf_link_input_bfd (finfo, input_bfd)
irela->r_offset += o->output_offset;
+ /* Relocs in an executable have to be virtual addresses. */
+ if (finfo->info->emitrelocations)
+ irela->r_offset += o->output_section->vma;
+
r_symndx = ELF_R_SYM (irela->r_info);
if (r_symndx == 0)