mirror of
https://git.musl-libc.org/git/musl
synced 2025-01-21 21:52:04 +03:00
fix double-processing of DT_RELR relocations in ldso relocating itself
this is analogous to skip_relative logic in do_relocs -- because relative relocations for the dynamic linker itself were already performed at entry (stage 1), they must not be applied again.
This commit is contained in:
parent
b50eb8c36c
commit
29e4319178
@ -552,6 +552,7 @@ static void do_relocs(struct dso *dso, size_t *rel, size_t rel_size, size_t stri
|
|||||||
|
|
||||||
static void do_relr_relocs(struct dso *dso, size_t *relr, size_t relr_size)
|
static void do_relr_relocs(struct dso *dso, size_t *relr, size_t relr_size)
|
||||||
{
|
{
|
||||||
|
if (dso == &ldso) return; /* self-relocation was done in _dlstart */
|
||||||
unsigned char *base = dso->base;
|
unsigned char *base = dso->base;
|
||||||
size_t *reloc_addr;
|
size_t *reloc_addr;
|
||||||
for (; relr_size; relr++, relr_size-=sizeof(size_t))
|
for (; relr_size; relr++, relr_size-=sizeof(size_t))
|
||||||
|
Loading…
Reference in New Issue
Block a user