Merge "Adjust DT_MIPS_RLD_MAP2 value"
This commit is contained in:
commit
df877d7b28
@ -472,6 +472,16 @@ void ElfFile<ELF>::AdjustDynamicSectionForHole(Elf_Scn* dynamic_section,
|
|||||||
<< " d_val adjusted to " << dynamic->d_un.d_val;
|
<< " d_val adjusted to " << dynamic->d_un.d_val;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Special case: DT_MIPS_RLD_MAP2 stores the difference between dynamic
|
||||||
|
// entry address and the address of the _r_debug (used by GDB)
|
||||||
|
// since the dynamic section and target address are on the
|
||||||
|
// different sides of the hole it needs to be adjusted accordingly
|
||||||
|
if (tag == DT_MIPS_RLD_MAP2) {
|
||||||
|
dynamic->d_un.d_val += hole_size;
|
||||||
|
VLOG(1) << "dynamic[" << i << "] " << dynamic->d_tag
|
||||||
|
<< " d_val adjusted to " << dynamic->d_un.d_val;
|
||||||
|
}
|
||||||
|
|
||||||
// Ignore DT_RELCOUNT and DT_RELACOUNT: (1) nobody uses them and
|
// Ignore DT_RELCOUNT and DT_RELACOUNT: (1) nobody uses them and
|
||||||
// technically (2) the relative relocation count is not changed.
|
// technically (2) the relative relocation count is not changed.
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@
|
|||||||
#include "elf.h"
|
#include "elf.h"
|
||||||
#include "libelf.h"
|
#include "libelf.h"
|
||||||
|
|
||||||
|
#if !defined(DT_MIPS_RLD_MAP2)
|
||||||
|
#define DT_MIPS_RLD_MAP2 0x70000035
|
||||||
|
#endif
|
||||||
|
|
||||||
// ELF is a traits structure used to provide convenient aliases for
|
// ELF is a traits structure used to provide convenient aliases for
|
||||||
// 32/64 bit Elf types and functions, depending on the target file.
|
// 32/64 bit Elf types and functions, depending on the target file.
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user