From: Jim Kingdon Date: Fri, 28 Jan 1994 16:25:25 +0000 (+0000) Subject: * config/pa/tm-hppa.h: Define macro SMASH_TEXT_ADDRESS. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=9fdb3f7aad80699becae8d400d181a2b924fb0a5;p=binutils-gdb.git * 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. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 1ebe34a713b..831c121cb61 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -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:". diff --git a/gdb/config/pa/tm-hppa.h b/gdb/config/pa/tm-hppa.h index f2afcc13973..4d970eacf06 100644 --- a/gdb/config/pa/tm-hppa.h +++ b/gdb/config/pa/tm-hppa.h @@ -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 diff --git a/gdb/dwarfread.c b/gdb/dwarfread.c index 1d8931a3009..956fb7e6d59 100644 --- a/gdb/dwarfread.c +++ b/gdb/dwarfread.c @@ -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: diff --git a/gdb/elfread.c b/gdb/elfread.c index 9b5b34c5692..5e8292c67ae 100644 --- a/gdb/elfread.c +++ b/gdb/elfread.c @@ -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: diff --git a/gdb/paread.c b/gdb/paread.c index 686bed6d005..3c4755d62d4 100644 --- a/gdb/paread.c +++ b/gdb/paread.c @@ -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: