summaryrefslogtreecommitdiffstats
path: root/binutils-2.25/bfd/elfxx-mips.c
diff options
context:
space:
mode:
authorMatthew Fortune <matthew.fortune@imgtec.com>2016-04-20 14:32:47 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-04-20 14:32:47 +0000
commit52d9ff81dbe9a79e6c0bace624091067b046948b (patch)
tree28f1e935577597f7616c87a4b3debf47766d3f6e /binutils-2.25/bfd/elfxx-mips.c
parent1e5714ccaf589fc08d1d5e0335c512b8ce5b3034 (diff)
parent39f13fa25e4d4d73a13687dfc1fca67916967018 (diff)
downloadtoolchain_binutils-52d9ff81dbe9a79e6c0bace624091067b046948b.tar.gz
toolchain_binutils-52d9ff81dbe9a79e6c0bace624091067b046948b.tar.bz2
toolchain_binutils-52d9ff81dbe9a79e6c0bace624091067b046948b.zip
Add support for DT_MIPS_RLD_MAP_REL. am: a696d1d
am: 39f13fa * commit '39f13fa25e4d4d73a13687dfc1fca67916967018': Add support for DT_MIPS_RLD_MAP_REL. Change-Id: If9a8ff3fec7800d77db1d46965f53a5410f9c7a7
Diffstat (limited to 'binutils-2.25/bfd/elfxx-mips.c')
-rw-r--r--binutils-2.25/bfd/elfxx-mips.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/binutils-2.25/bfd/elfxx-mips.c b/binutils-2.25/bfd/elfxx-mips.c
index a876ff3b..3b777597 100644
--- a/binutils-2.25/bfd/elfxx-mips.c
+++ b/binutils-2.25/bfd/elfxx-mips.c
@@ -7616,7 +7616,7 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
htab->sstubs = s;
if (!mips_elf_hash_table (info)->use_rld_obj_head
- && !info->shared
+ && info->executable
&& bfd_get_linker_section (abfd, ".rld_map") == NULL)
{
s = bfd_make_section_anyway_with_flags (abfd, ".rld_map",
@@ -7680,7 +7680,7 @@ _bfd_mips_elf_create_dynamic_sections (bfd *abfd, struct bfd_link_info *info)
(void) bfd_set_section_alignment (abfd, s, MIPS_ELF_LOG_FILE_ALIGN (abfd));
}
- if (!info->shared)
+ if (info->executable)
{
const char *name;
@@ -9721,7 +9721,7 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
info->combreloc = 0;
}
}
- else if (! info->shared
+ else if (info->executable
&& ! mips_elf_hash_table (info)->use_rld_obj_head
&& CONST_STRNEQ (name, ".rld_map"))
{
@@ -9784,6 +9784,10 @@ _bfd_mips_elf_size_dynamic_sections (bfd *output_bfd,
&& !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP, 0))
return FALSE;
+ if (info->executable
+ && !MIPS_ELF_ADD_DYNAMIC_ENTRY (info, DT_MIPS_RLD_MAP_REL, 0))
+ return FALSE;
+
/* The DT_DEBUG entry may be filled in by the dynamic linker and
used by the debugger. */
if (info->executable
@@ -11492,11 +11496,37 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
break;
}
s = h->root.u.def.section;
+
+ /* The MIPS_RLD_MAP tag stores the absolute address of the
+ debug pointer. */
dyn.d_un.d_ptr = (s->output_section->vma + s->output_offset
+ h->root.u.def.value);
}
break;
+ case DT_MIPS_RLD_MAP_REL:
+ {
+ struct elf_link_hash_entry *h;
+ bfd_vma dt_addr, rld_addr;
+ h = mips_elf_hash_table (info)->rld_symbol;
+ if (!h)
+ {
+ dyn_to_skip = MIPS_ELF_DYN_SIZE (dynobj);
+ swap_out_p = FALSE;
+ break;
+ }
+ s = h->root.u.def.section;
+
+ /* The MIPS_RLD_MAP_REL tag stores the offset to the debug
+ pointer, relative to the address of the tag. */
+ dt_addr = (sdyn->output_section->vma + sdyn->output_offset
+ + b - sdyn->contents);
+ rld_addr = (s->output_section->vma + s->output_offset
+ + h->root.u.def.value);
+ dyn.d_un.d_ptr = rld_addr - dt_addr;
+ }
+ break;
+
case DT_MIPS_OPTIONS:
s = (bfd_get_section_by_name
(output_bfd, MIPS_ELF_OPTIONS_SECTION_NAME (output_bfd)));
@@ -15421,6 +15451,8 @@ _bfd_mips_elf_get_target_dtag (bfd_vma dtag)
return "MIPS_HIPAGENO";
case DT_MIPS_RLD_MAP:
return "MIPS_RLD_MAP";
+ case DT_MIPS_RLD_MAP_REL:
+ return "MIPS_RLD_MAP_REL";
case DT_MIPS_DELTA_CLASS:
return "MIPS_DELTA_CLASS";
case DT_MIPS_DELTA_CLASS_NO: