mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-12-25 20:27:55 +01:00
Take the mapping's segment offset into account when resolving symbols.
Reported by: Jenkins, via asomers MFC after: 2 weeks
This commit is contained in:
parent
d76b989004
commit
5aa9b11b61
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=336592
@ -520,7 +520,8 @@ proc_addr2sym(struct proc_handle *p, uintptr_t addr, char *name,
|
||||
}
|
||||
|
||||
file = mapping->file;
|
||||
off = file->ehdr.e_type == ET_DYN ? mapping->map.pr_vaddr : 0;
|
||||
off = file->ehdr.e_type == ET_DYN ?
|
||||
mapping->map.pr_vaddr - mapping->map.pr_offset : 0;
|
||||
if (addr < off)
|
||||
return (ENOENT);
|
||||
addr -= off;
|
||||
@ -623,7 +624,8 @@ proc_name2sym(struct proc_handle *p, const char *object, const char *symbol,
|
||||
}
|
||||
|
||||
file = mapping->file;
|
||||
off = file->ehdr.e_type == ET_DYN ? mapping->map.pr_vaddr : 0;
|
||||
off = file->ehdr.e_type == ET_DYN ?
|
||||
mapping->map.pr_vaddr - mapping->map.pr_offset : 0;
|
||||
|
||||
error = lookup_symbol_by_name(file->elf, &file->dynsymtab, symbol,
|
||||
symcopy, si);
|
||||
|
Loading…
Reference in New Issue
Block a user