diff options
author | Eugene Tarassov | 2017-01-17 21:14:33 +0000 |
---|---|---|
committer | Eugene Tarassov | 2017-01-17 21:14:33 +0000 |
commit | b6be117517f7123c6cbf4792e77d242f152eae9f (patch) | |
tree | a3f814f147021cee56e70ae9a405e0f362e68cd5 | |
parent | 39e9b0b5c4a5245b326629141de6632e94521fb9 (diff) | |
download | org.eclipse.tcf.agent-b6be117517f7123c6cbf4792e77d242f152eae9f.tar.gz org.eclipse.tcf.agent-b6be117517f7123c6cbf4792e77d242f152eae9f.tar.xz org.eclipse.tcf.agent-b6be117517f7123c6cbf4792e77d242f152eae9f.zip |
TCF Agent: fixed computation of "is weak" symbol attribute
The code was missing link-time to run-time address translation and worked incorrectly when section is relocated
-rw-r--r-- | agent/tcf/services/symbols_elf.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/agent/tcf/services/symbols_elf.c b/agent/tcf/services/symbols_elf.c index b5f79f7d..96114af1 100644 --- a/agent/tcf/services/symbols_elf.c +++ b/agent/tcf/services/symbols_elf.c @@ -517,9 +517,12 @@ static int symbol_is_weak(ObjectInfo * obj) { case STT_OBJECT: case STT_FUNC: if (equ_symbol_names(name, sym_info.name)) { - ContextAddress address = 0; - if (elf_symbol_address(sym_ctx, &sym_info, &address)) break; - if (obj->u.mCode.mLowPC != address) { + ContextAddress sym_addr = 0; + ContextAddress obj_addr = 0; + if (elf_symbol_address(sym_ctx, &sym_info, &sym_addr) < 0) break; + obj_addr = elf_map_to_run_time_address(sym_ctx, file, obj->u.mCode.mSection, obj->u.mCode.mLowPC); + if (errno) break; + if (obj_addr != sym_addr) { clear_trap(&trap); return 1; } |