mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-06-25 21:41:47 +08:00
Fix DT_MIPS_RLD_MAP_REL tag for n64 target and 32-bit host.
For the case of MIPS n64 target and 32-bit host, the computation of the DT_MIPS_RLD_MAP_REL tag involves sdyn->output_section->vma + sdyn->output_offset (64-bit) being added to b (32-bit host pointer), so losing the high part and resulting in an incorrect DT_MIPS_RLD_MAP_REL tag, and all dynamically linked glibc tests failing for n64. This patch fixes this (spot-tested with glibc tests; however, I don't have a self-contained testcase for this bug). * elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections) <DT_MIPS_RLD_MAP_REL>: Add target address to host address difference, not to host pointer.
This commit is contained in:
@ -1,3 +1,9 @@
|
|||||||
|
2015-07-23 Joseph Myers <joseph@codesourcery.com>
|
||||||
|
|
||||||
|
* elfxx-mips.c (_bfd_mips_elf_finish_dynamic_sections)
|
||||||
|
<DT_MIPS_RLD_MAP_REL>: Add target address to host address
|
||||||
|
difference, not to host pointer.
|
||||||
|
|
||||||
2015-07-22 Alan Modra <amodra@gmail.com>
|
2015-07-22 Alan Modra <amodra@gmail.com>
|
||||||
|
|
||||||
* elf64-ppc.c (opd_entry_value): Remove assertion. Instead,
|
* elf64-ppc.c (opd_entry_value): Remove assertion. Instead,
|
||||||
|
@ -11515,7 +11515,7 @@ _bfd_mips_elf_finish_dynamic_sections (bfd *output_bfd,
|
|||||||
/* The MIPS_RLD_MAP_REL tag stores the offset to the debug
|
/* The MIPS_RLD_MAP_REL tag stores the offset to the debug
|
||||||
pointer, relative to the address of the tag. */
|
pointer, relative to the address of the tag. */
|
||||||
dt_addr = (sdyn->output_section->vma + sdyn->output_offset
|
dt_addr = (sdyn->output_section->vma + sdyn->output_offset
|
||||||
+ b - sdyn->contents);
|
+ (b - sdyn->contents));
|
||||||
rld_addr = (s->output_section->vma + s->output_offset
|
rld_addr = (s->output_section->vma + s->output_offset
|
||||||
+ h->root.u.def.value);
|
+ h->root.u.def.value);
|
||||||
dyn.d_un.d_ptr = rld_addr - dt_addr;
|
dyn.d_un.d_ptr = rld_addr - dt_addr;
|
||||||
|
Reference in New Issue
Block a user