mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-07 06:03:10 +00:00
lib: fix elf_py TLS section handling
... need to ignore TLS sections, their address is effectively meaningless but can overlap other sections we actually need to access. Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
This commit is contained in:
parent
8d4e934b08
commit
3942ee1f7b
@ -636,6 +636,9 @@ static Elf_Scn *elf_find_addr(struct elffile *ef, uint64_t addr, size_t *idx)
|
|||||||
Elf_Scn *scn = elf_getscn(ef->elf, i);
|
Elf_Scn *scn = elf_getscn(ef->elf, i);
|
||||||
GElf_Shdr _shdr, *shdr = gelf_getshdr(scn, &_shdr);
|
GElf_Shdr _shdr, *shdr = gelf_getshdr(scn, &_shdr);
|
||||||
|
|
||||||
|
/* virtual address is kinda meaningless for TLS sections */
|
||||||
|
if (shdr->sh_flags & SHF_TLS)
|
||||||
|
continue;
|
||||||
if (addr < shdr->sh_addr ||
|
if (addr < shdr->sh_addr ||
|
||||||
addr >= shdr->sh_addr + shdr->sh_size)
|
addr >= shdr->sh_addr + shdr->sh_size)
|
||||||
continue;
|
continue;
|
||||||
|
Loading…
Reference in New Issue
Block a user