From a147cc55c352fecdfe6835af8100403594b79dad Mon Sep 17 00:00:00 2001 From: hunt Date: Mon, 2 Jul 2007 07:17:10 +0000 Subject: [PATCH] 2007-07-02 Martin Hunt * symbols.c (get_sections): Set data pointer to the lowest address of any data section. --- runtime/staprun/ChangeLog | 5 +++++ runtime/staprun/symbols.c | 6 ++++-- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/runtime/staprun/ChangeLog b/runtime/staprun/ChangeLog index af2c647e9..018e8024e 100644 --- a/runtime/staprun/ChangeLog +++ b/runtime/staprun/ChangeLog @@ -1,3 +1,8 @@ +2007-07-02 Martin Hunt + + * symbols.c (get_sections): Set data pointer to the lowest address + of any data section. + 2007-06-21 Martin Hunt * relay.c (init_relayfs): Send message to check for bulkmode. diff --git a/runtime/staprun/symbols.c b/runtime/staprun/symbols.c index c8758c37a..49755c5e0 100644 --- a/runtime/staprun/symbols.c +++ b/runtime/staprun/symbols.c @@ -92,8 +92,10 @@ static int get_sections(char *name, char *data_start, int datalen) strdata += strlen(secname) + 1; /* These sections are used a lot so keep the values handy */ - if (!strcmp(secname, ".data")) - mod->data = sec->addr; + if (!strcmp(secname, ".data") || !strncmp(secname, ".rodata", 7)) { + if (mod->data == 0 || sec->addr < mod->data) + mod->data = sec->addr; + } if (!strcmp(secname, ".text")) mod->text = sec->addr; if (!strcmp(secname, ".gnu.linkonce.this_module")) -- 2.43.5