* config/pa/tm-hppa.h: Define macro SMASH_TEXT_ADDRESS.

* elfread.c (record_minimal_symbol_and_info),
	dwarfread.c (process_dies), paread.c (pa_symtab_read): Use it.
This commit is contained in:
Jim Kingdon 1994-01-28 16:25:25 +00:00
parent 0b233d31df
commit 9fdb3f7aad
5 changed files with 31 additions and 8 deletions

View File

@ -1,3 +1,9 @@
Fri Jan 28 10:40:34 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* config/pa/tm-hppa.h: Define macro SMASH_TEXT_ADDRESS.
* elfread.c (record_minimal_symbol_and_info),
dwarfread.c (process_dies), paread.c (pa_symtab_read): Use it.
Thu Jan 27 15:12:23 1994 Jim Kingdon (kingdon@lioth.cygnus.com)
* i386-stub.c: Add ".text" right before "mem_fault:".

View File

@ -404,11 +404,14 @@ CORE_ADDR hppa_fix_call_dummy();
#define PUSH_ARGUMENTS(nargs, args, sp, struct_return, struct_addr) \
sp = hppa_push_arguments(nargs, args, sp, struct_return, struct_addr)
/* Symbol files have two symbol tables. Rather than do this right,
like the ELF symbol reading code, massive hackery was added
to dbxread.c and partial-stab.h. This flag turns on that
hackery, which should all go away FIXME FIXME FIXME FIXME now. */
/* The low two bits of the PC on the PA contain the privilege level. Some
genius implementing a (non-GCC) compiler apparently decided this means
that "addresses" in a text section therefore include a privilege level,
and thus symbol tables should contain these bits. This seems like a
bonehead thing to do--anyway, it seems to work for our purposes to just
ignore those bits. */
#define SMASH_TEXT_ADDRESS(addr) ((addr) &= ~0x3)
#define GDB_TARGET_IS_HPPA

View File

@ -1989,6 +1989,11 @@ process_dies (thisdie, enddie, objfile)
{
nextdie = thisdie + di.die_length;
}
#ifdef SMASH_TEXT_ADDRESS
/* I think that these are always text, not data, addresses. */
SMASH_TEXT_ADDRESS (di.at_low_pc);
SMASH_TEXT_ADDRESS (di.at_high_pc);
#endif
switch (di.die_tag)
{
case TAG_compile_unit:

View File

@ -190,6 +190,9 @@ record_minimal_symbol_and_info (name, address, ms_type, info, objfile)
case mst_text:
case mst_file_text:
section = SECT_OFF_TEXT;
#ifdef SMASH_TEXT_ADDRESS
SMASH_TEXT_ADDRESS (address);
#endif
break;
case mst_data:
case mst_file_data:

View File

@ -158,7 +158,9 @@ pa_symtab_read (abfd, addr, objfile)
case ST_MILLICODE:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_text;
bufp->symbol_value &= ~0x3; /* clear out permission bits */
#ifdef SMASH_TEXT_ADDRESS
SMASH_TEXT_ADDRESS (bufp->symbol_value);
#endif
break;
case ST_DATA:
symname = bufp->name.n_strx + stringtab;
@ -183,7 +185,9 @@ pa_symtab_read (abfd, addr, objfile)
case ST_CODE:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_file_text;
bufp->symbol_value &= ~0x3; /* clear out permission bits */
#ifdef SMASH_TEXT_ADDRESS
SMASH_TEXT_ADDRESS (bufp->symbol_value);
#endif
check_strange_names:
/* GAS leaves labels in .o files after assembling. At
@ -207,7 +211,9 @@ pa_symtab_read (abfd, addr, objfile)
case ST_MILLICODE:
symname = bufp->name.n_strx + stringtab;
ms_type = mst_file_text;
bufp->symbol_value &= ~0x3; /* clear out permission bits */
#ifdef SMASH_TEXT_ADDRESS
SMASH_TEXT_ADDRESS (bufp->symbol_value);
#endif
break;
case ST_DATA: