[Ups-cvs] ups/ups ao_dwfsyms.c,1.23,1.24 ao_dwftext.c,1.6,1.7 ao_elflib.c,1.15,1.16 ao_syms.h,1.4,1.
Brought to you by:
ianedwards
From: Tom H. <th...@us...> - 2005-02-21 12:21:20
|
Update of /cvsroot/ups/ups/ups In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21543 Modified Files: ao_dwfsyms.c ao_dwftext.c ao_elflib.c ao_syms.h ao_text.c Log Message: Maintain a separate symbol base address for DWARF symbols as prelinked libraries on linux systems have the normal base address as zero because prelinking modifies the ELF symbols to have absolute addresses. The entries in the DWARF symbol table are still relative to the load address though so we need a different base address for them. Index: ao_dwftext.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwftext.c,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** ao_dwftext.c 21 Feb 2004 17:00:00 -0000 1.6 --- ao_dwftext.c 21 Feb 2005 12:20:59 -0000 1.7 *************** *** 399,403 **** { ao_stdata_t *ast = AO_STDATA(st); ! taddr_t adjusted_pc = *pc - ast->st_base_address; if (dwf_unwind(ast->st_dw_dbg, xp, fp, sp, &adjusted_pc)) { --- 399,403 ---- { ao_stdata_t *ast = AO_STDATA(st); ! taddr_t adjusted_pc = *pc - ast->st_dw_base_address; if (dwf_unwind(ast->st_dw_dbg, xp, fp, sp, &adjusted_pc)) { Index: ao_syms.h =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_syms.h,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** ao_syms.h 24 Nov 2003 13:21:50 -0000 1.4 --- ao_syms.h 21 Feb 2005 12:21:05 -0000 1.5 *************** *** 147,150 **** --- 147,151 ---- Dwarf_Debug st_dw_dbg; /* Handle for libdwarf calls */ bool st_dw_scanned; /* Dwarf symbols scanned? */ + taddr_t st_dw_base_address; /* Addr shlib mapped rel to Dwarf sym addrs */ #endif Index: ao_elflib.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_elflib.c,v retrieving revision 1.15 retrieving revision 1.16 diff -C2 -d -r1.15 -r1.16 *** ao_elflib.c 18 Feb 2005 10:18:03 -0000 1.15 --- ao_elflib.c 21 Feb 2005 12:20:59 -0000 1.16 *************** *** 396,399 **** --- 396,407 ---- change_base_address(so->symtab, base_address); + + #if WANT_DWARF + if (base_address != 0) { + ao_stdata_t *ast = AO_STDATA(so->symtab); + + ast->st_dw_base_address = base_address; + } + #endif } Index: ao_text.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_text.c,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** ao_text.c 21 Feb 2004 16:34:40 -0000 1.9 --- ao_text.c 21 Feb 2005 12:21:05 -0000 1.10 *************** *** 256,259 **** --- 256,260 ---- ast->st_dw_dbg = 0; ast->st_dw_scanned = FALSE; + ast->st_dw_base_address = ei->text_mem_addr; if (st_is == ST_DWARF) { ast->st_dw_dbg = dw_dbg; Index: ao_dwfsyms.c =================================================================== RCS file: /cvsroot/ups/ups/ups/ao_dwfsyms.c,v retrieving revision 1.23 retrieving revision 1.24 diff -C2 -d -r1.23 -r1.24 *** ao_dwfsyms.c 23 Nov 2004 16:26:57 -0000 1.23 --- ao_dwfsyms.c 21 Feb 2005 12:20:59 -0000 1.24 *************** *** 1324,1328 **** * Start a new 'stf'. */ ! stf = make_stf(ap, cu_name, st, 0, lang, ast->st_base_address); stf->stf_symlim = -1; stf->stf_fnum = -1; --- 1324,1328 ---- * Start a new 'stf'. */ ! stf = make_stf(ap, cu_name, st, 0, lang, ast->st_dw_base_address); stf->stf_symlim = -1; stf->stf_fnum = -1; |