From: Jeff Law Date: Thu, 27 Jun 2002 22:57:02 +0000 (+0000) Subject: * elf64-hppa.c (elf64_hppa_reloc_type_class): New function. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5ac81c745ef8c328928b4b88d5183b061640b76e;p=binutils-gdb.git * elf64-hppa.c (elf64_hppa_reloc_type_class): New function. (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec and opd_rel_sec in order for starting rela section. Check _raw_size. (elf_backend_reloc_type_class): Define. --- diff --git a/bfd/ChangeLog b/bfd/ChangeLog index 68f0282370e..c4a68787381 100644 --- a/bfd/ChangeLog +++ b/bfd/ChangeLog @@ -1,3 +1,10 @@ +2002-06-27 John David Anglin + + * elf64-hppa.c (elf64_hppa_reloc_type_class): New function. + (elf64_hppa_finish_dynamic_sections): Check other_rel_sec, dlt_rel_sec + and opd_rel_sec in order for starting rela section. Check _raw_size. + (elf_backend_reloc_type_class): Define. + 2002-06-27 Kevin Buettner * dwarf2.c (decode_line_info): Handle older, non-standard, 64-bit diff --git a/bfd/elf64-hppa.c b/bfd/elf64-hppa.c index 5851dee7f55..929cacd18ed 100644 --- a/bfd/elf64-hppa.c +++ b/bfd/elf64-hppa.c @@ -213,6 +213,9 @@ static int elf64_hppa_additional_program_headers PARAMS ((bfd *)); static boolean elf64_hppa_modify_segment_map PARAMS ((bfd *)); +static enum elf_reloc_type_class elf64_hppa_reloc_type_class + PARAMS ((const Elf_Internal_Rela *)); + static boolean elf64_hppa_finish_dynamic_sections PARAMS ((bfd *, struct bfd_link_info *)); @@ -2470,6 +2473,27 @@ elf64_hppa_finalize_dynreloc (dyn_h, data) return true; } +/* Used to decide how to sort relocs in an optimal manner for the + dynamic linker, before writing them out. */ + +static enum elf_reloc_type_class +elf64_hppa_reloc_type_class (rela) + const Elf_Internal_Rela *rela; +{ + if (ELF64_R_SYM (rela->r_info) == 0) + return reloc_class_relative; + + switch ((int) ELF64_R_TYPE (rela->r_info)) + { + case R_PARISC_IPLT: + return reloc_class_plt; + case R_PARISC_COPY: + return reloc_class_copy; + default: + return reloc_class_normal; + } +} + /* Finish up the dynamic sections. */ static boolean @@ -2553,8 +2577,10 @@ elf64_hppa_finish_dynamic_sections (output_bfd, info) case DT_RELA: s = hppa_info->other_rel_sec; - if (! s) + if (! s || ! s->_raw_size) s = hppa_info->dlt_rel_sec; + if (! s || ! s->_raw_size) + s = hppa_info->opd_rel_sec; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; bfd_elf64_swap_dyn_out (output_bfd, &dyn, dyncon); break; @@ -2780,6 +2806,7 @@ const struct elf_size_info hppa64_elf_size_info = #define elf_backend_plt_header_size 0 #define elf_backend_type_change_ok true #define elf_backend_get_symbol_type elf64_hppa_elf_get_symbol_type +#define elf_backend_reloc_type_class elf64_hppa_reloc_type_class #include "elf64-target.h"