aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf64-alpha.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2000-04-03 12:42:18 +0000
committerAlan Modra <amodra@gmail.com>2000-04-03 12:42:18 +0000
commitc555c5c58e07aec1d70bd969e49e5f9609a73be0 (patch)
treeb65321365d5df78ed3edf0d563013c756c10adbe /bfd/elf64-alpha.c
parent71851002d0b8dcdfb99163d0cbae706a80cd076a (diff)
downloadgdb-c555c5c58e07aec1d70bd969e49e5f9609a73be0.zip
gdb-c555c5c58e07aec1d70bd969e49e5f9609a73be0.tar.gz
gdb-c555c5c58e07aec1d70bd969e49e5f9609a73be0.tar.bz2
Don't emit relative relocations for non-loaded sections in shared objects.
Fix for DWARF-2 sections .debug_info and .debug_line.
Diffstat (limited to 'bfd/elf64-alpha.c')
-rw-r--r--bfd/elf64-alpha.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/bfd/elf64-alpha.c b/bfd/elf64-alpha.c
index c8d8f0e..4da9e92 100644
--- a/bfd/elf64-alpha.c
+++ b/bfd/elf64-alpha.c
@@ -2581,9 +2581,10 @@ elf64_alpha_check_relocs (abfd, info, sec, relocs)
else
rent->count++;
}
- else if (info->shared)
+ else if (info->shared && (sec->flags & SEC_ALLOC))
{
- /* If this is a shared library, we need a RELATIVE reloc. */
+ /* If this is a shared library, and the section is to be
+ loaded into memory, we need a RELATIVE reloc. */
sreloc->_raw_size += sizeof (Elf64_External_Rela);
}
break;
@@ -3623,7 +3624,7 @@ elf64_alpha_relocate_section (output_bfd, info, input_bfd, input_section,
outrel.r_addend = addend;
addend = 0, relocation = 0;
}
- else if (info->shared)
+ else if (info->shared && (input_section->flags & SEC_ALLOC))
{
outrel.r_info = ELF64_R_INFO(0, R_ALPHA_RELATIVE);
outrel.r_addend = 0;