diff options
author | Dave Brolley <brolley@redhat.com> | 2009-06-29 12:24:53 -0400 |
---|---|---|
committer | Dave Brolley <brolley@redhat.com> | 2009-06-29 12:24:53 -0400 |
commit | b2b6260ce7093deb44a70835a38fd7199f0b0954 (patch) | |
tree | 5417d4f380c975132e70221f70f37d2d92da0b02 /translate.cxx | |
parent | 67efafc24aa4e415a01674a0eff04abcb1c1165d (diff) | |
parent | 2fd285e65eb8e1f77cb5b70a1f81377896ad6b2c (diff) | |
download | systemtap-steved-b2b6260ce7093deb44a70835a38fd7199f0b0954.tar.gz systemtap-steved-b2b6260ce7093deb44a70835a38fd7199f0b0954.tar.xz systemtap-steved-b2b6260ce7093deb44a70835a38fd7199f0b0954.zip |
Merge branch 'master' of git://sources.redhat.com/git/systemtap
Diffstat (limited to 'translate.cxx')
-rw-r--r-- | translate.cxx | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/translate.cxx b/translate.cxx index 172c1287..9e2bd99d 100644 --- a/translate.cxx +++ b/translate.cxx @@ -4439,13 +4439,13 @@ struct unwindsym_dump_context // Get the .debug_frame end .eh_frame sections for the given module. // Also returns the lenght of both sections when found, plus the section -// address of the eh_frame data. +// address (offset) of the eh_frame data. static void get_unwind_data (Dwfl_Module *m, void **debug_frame, void **eh_frame, size_t *debug_len, size_t *eh_len, Dwarf_Addr *eh_addr) { - Dwarf_Addr bias = 0; + Dwarf_Addr start, bias = 0; GElf_Ehdr *ehdr, ehdr_mem; GElf_Shdr *shdr, shdr_mem; Elf_Scn *scn; @@ -4453,6 +4453,7 @@ static void get_unwind_data (Dwfl_Module *m, Elf *elf; // fetch .eh_frame info preferably from main elf file. + dwfl_module_info (m, NULL, &start, NULL, NULL, NULL, NULL, NULL); elf = dwfl_module_getelf(m, &bias); ehdr = gelf_getehdr(elf, &ehdr_mem); scn = NULL; @@ -4465,7 +4466,11 @@ static void get_unwind_data (Dwfl_Module *m, data = elf_rawdata(scn, NULL); *eh_frame = data->d_buf; *eh_len = data->d_size; - *eh_addr = shdr->sh_addr; + // For ".dynamic" sections we want the offset, not absolute addr. + if (dwfl_module_relocations (m) > 0) + *eh_addr = shdr->sh_addr - start + bias; + else + *eh_addr = shdr->sh_addr; break; } } |