Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEugene Tarassov2017-01-17 21:14:33 +0000
committerEugene Tarassov2017-01-17 21:14:33 +0000
commitb6be117517f7123c6cbf4792e77d242f152eae9f (patch)
treea3f814f147021cee56e70ae9a405e0f362e68cd5
parent39e9b0b5c4a5245b326629141de6632e94521fb9 (diff)
downloadorg.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.c9
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;
}

Back to the top