Don't emit relative relocations for non-loaded sections in shared objects.

Fix for DWARF-2 sections .debug_info and .debug_line.
This commit is contained in:
Alan Modra
2000-04-03 12:42:18 +00:00
parent 71851002d0
commit c555c5c58e
2 changed files with 13 additions and 6 deletions

View File

@@ -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;