diff options
author | Alan Modra <amodra@gmail.com> | 2022-01-13 10:59:30 +1030 |
---|---|---|
committer | Alan Modra <amodra@gmail.com> | 2022-01-13 14:12:43 +1030 |
commit | 9c3d7d9b7ed5f442fea1ddcb41fc1e0488f51588 (patch) | |
tree | b235b4cc382656f2fdc9e92832af28f08579b271 /bfd/elfxx-x86.c | |
parent | 0ae1246717ffbabda5d54be8def95f4424147c0f (diff) | |
download | gdb-9c3d7d9b7ed5f442fea1ddcb41fc1e0488f51588.zip gdb-9c3d7d9b7ed5f442fea1ddcb41fc1e0488f51588.tar.gz gdb-9c3d7d9b7ed5f442fea1ddcb41fc1e0488f51588.tar.bz2 |
Move DT_RELR tag setting to elflink.c
This makes the code setting DT_RELR tags generally available. Many
targets will be able to use the defaults. Those that can't should set
up sh_entsize for .relr.dyn output section before reaching the dynamic
tag code in bfd_elf_final_link.
* elflink.c (bfd_elf_final_link): Set up DT_RELR tags and sh_entsize.
* elfxx-x86.c (_bfd_x86_elf_finish_dynamic_sections): Don't do any
of that here.
Diffstat (limited to 'bfd/elfxx-x86.c')
-rw-r--r-- | bfd/elfxx-x86.c | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/bfd/elfxx-x86.c b/bfd/elfxx-x86.c index 119929b..da8a488 100644 --- a/bfd/elfxx-x86.c +++ b/bfd/elfxx-x86.c @@ -2388,7 +2388,6 @@ _bfd_x86_elf_finish_dynamic_sections (bfd *output_bfd, asection *sdyn; bfd_byte *dyncon, *dynconend; bfd_size_type sizeof_dyn; - bfd_size_type dt_relr_bitmap_count; bed = get_elf_backend_data (output_bfd); htab = elf_x86_hash_table (info, bed->target_id); @@ -2447,8 +2446,6 @@ _bfd_x86_elf_finish_dynamic_sections (bfd *output_bfd, if (sdyn == NULL || htab->elf.sgot == NULL) abort (); - dt_relr_bitmap_count = htab->dt_relr_bitmap.count; - sizeof_dyn = bed->s->sizeof_dyn; dyncon = sdyn->contents; dynconend = sdyn->contents + sdyn->size; @@ -2467,28 +2464,6 @@ _bfd_x86_elf_finish_dynamic_sections (bfd *output_bfd, break; continue; - case DT_NULL: - if (dt_relr_bitmap_count != 0) - { - /* Convert 3 spare dynamic tags to DT_RELR, DT_RELRSZ and - DT_RELRENT for compact relative relocation. */ - s = htab->elf.srelrdyn; - dyn.d_tag = DT_RELR; - dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; - (*bed->s->swap_dyn_out) (output_bfd, &dyn, dyncon); - dyncon += sizeof_dyn; - dyn.d_tag = DT_RELRSZ; - dyn.d_un.d_val = s->size; - (*bed->s->swap_dyn_out) (output_bfd, &dyn, dyncon); - dyncon += sizeof_dyn; - dyn.d_tag = DT_RELRENT; - dyn.d_un.d_val = ABI_64_P (output_bfd) ? 8 : 4; - elf_section_data (s->output_section)->this_hdr.sh_entsize - = dyn.d_un.d_val; - dt_relr_bitmap_count = 0; - } - break; - case DT_PLTGOT: s = htab->elf.sgotplt; dyn.d_un.d_ptr = s->output_section->vma + s->output_offset; |