From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Peter.Schauer" To: dberlin@redhat.com (Daniel Berlin) Cc: gdb-patches@sourceware.cygnus.com Subject: Re: symtab.h: 2000-10-12 SYMBOL_INIT_DEMANGLED_NAME change, why ? Date: Sat, 28 Oct 2000 12:55:00 -0000 Message-id: <200010281955.VAA14340@reisser.regent.e-technik.tu-muenchen.de> References: X-SW-Source: 2000-10/msg00259.html > There is no noticeable speed decrease due to this change. > I originally thought the actual likely culprit is somewhere in the stabsreader, the > SYMBOL_LANGUAGE not getting set in all cases. > But it turned out the current file's language was language_unknown for > some reason, at the point it wanted to set the symbol language. > However, I couldn't follow all the codepaths to track this down, due > to the gotos. > I didn't feel like wasting any more time on it, so i just fixed the > symptom, as you said. I would be volunteering to `waste' more time on it, if you can provide an example, as I'd rather like to fix the cause. -- Peter Schauer pes@regent.e-technik.tu-muenchen.de >From kevinb@cygnus.com Sat Oct 28 14:34:00 2000 From: Kevin Buettner To: Elena Zannoni Cc: gdb-patches@sourceware.cygnus.com Subject: [PATCH RFA] dwarf2read.c: symbol relocation in new_symbol() Date: Sat, 28 Oct 2000 14:34:00 -0000 Message-id: <1001028213434.ZM3907@ocotillo.lan> X-SW-Source: 2000-10/msg00260.html Content-length: 1725 AIX5/IA-64 relocates read-only and read/write sections by different amounts. The patch below fixes dwarf2read.c to account for this scenario. I was tempted to try to fix the other occurrences of baseaddr in this file, but decided to leave that for one our symtabs/dwarf2 experts. I've tested this patch on linux/x86 w/ -gdwarf-2 and saw no regressions. (I've also done some limited testing on AIX5 and it does indeed fix the problems that I was seeing.) Okay to commit? * dwarf2read.c (new_symbol): Relocate address of symbol by the base address of the section it is in rather than always using the base address of the .text section. Index: dwarf2read.c =================================================================== RCS file: /cvs/src/src/gdb/dwarf2read.c,v retrieving revision 1.16 diff -u -p -r1.16 dwarf2read.c --- dwarf2read.c 2000/08/04 16:51:47 1.16 +++ dwarf2read.c 2000/10/28 20:59:09 @@ -4185,7 +4185,10 @@ new_symbol (struct die_info *die, struct the variable is referenced. */ if (SYMBOL_VALUE_ADDRESS (sym)) { - SYMBOL_VALUE_ADDRESS (sym) += baseaddr; + fixup_symbol_section (sym, objfile); + SYMBOL_VALUE_ADDRESS (sym) += + ANOFFSET (objfile->section_offsets, + SYMBOL_SECTION (sym)); SYMBOL_CLASS (sym) = LOC_STATIC; } else @@ -4215,8 +4218,11 @@ new_symbol (struct die_info *die, struct } else { + fixup_symbol_section (sym, objfile); SYMBOL_CLASS (sym) = LOC_STATIC; - SYMBOL_VALUE_ADDRESS (sym) = addr + baseaddr; + SYMBOL_VALUE_ADDRESS (sym) = + addr + ANOFFSET (objfile->section_offsets, + SYMBOL_SECTION (sym)); } } }