This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
RFA: Convert references to constant pool symbols when emitting stabs debug info
- From: Nick Clifton <nickc at cambridge dot redhat dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: 07 Jan 2002 14:39:46 +0000
- Subject: RFA: Convert references to constant pool symbols when emitting stabs debug info
Hi Guys,
For some ports (eg ARM) symbols can be placed in the constant
pool and replaced by a local symbol. When STABS debug informtion is
emitted for these symbols, it is necessary to refer to the original
symbol and not the local symbol.
The patch below does this, duplicating the code in
dwarf2out.c:mem_loc_descriptor() which handles the same situation
for DWARF2 debug information.
May I apply this patch ?
Cheers
Nick
2002-01-07 Nick Clifton <nickc@cambridge.redhat.com>
* dbxout.c (dbxout_symbol_location): If a symbol ref is in the
constant pool, use the pool's version of the symbol instead.
Index: gcc/dbxout.c
===================================================================
RCS file: /cvs/gcc/gcc/gcc/dbxout.c,v
retrieving revision 1.113
diff -p -c -r1.113 dbxout.c
*** dbxout.c 2001/12/09 16:31:46 1.113
--- dbxout.c 2002/01/07 14:40:55
*************** dbxout_symbol_location (decl, type, suff
*** 2164,2169 ****
--- 2164,2183 ----
current_sym_code = DBX_STATIC_CONST_VAR_CODE;
else
{
+ /* Some ports can transform a symbol ref into a label ref,
+ because the symbol ref is too far away and has to be
+ dumped into a constant pool. Alternatively, the symbol
+ in the constant pool might be referenced by a different
+ symbol. */
+ if (GET_CODE (current_sym_addr) == SYMBOL_REF
+ && CONSTANT_POOL_ADDRESS_P (current_sym_addr))
+ {
+ rtx tmp = get_pool_constant (current_sym_addr);
+
+ if (GET_CODE (tmp) == SYMBOL_REF)
+ current_sym_addr = tmp;
+ }
+
/* Ultrix `as' seems to need this. */
#ifdef DBX_STATIC_STAB_DATA_SECTION
data_section ();