From b9f91bf7626f10baacbf7d3f595cc55745220964 Mon Sep 17 00:00:00 2001 From: mycroft Date: Tue, 24 Nov 1998 18:24:30 +0000 Subject: [PATCH] Don't overwrite the n_other field, either. --- gnu/usr.bin/gas/config/obj-aout.c | 31 +++++++++++++++++-------------- gnu/usr.bin/gas/config/obj-aout.h | 7 ++++++- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/gnu/usr.bin/gas/config/obj-aout.c b/gnu/usr.bin/gas/config/obj-aout.c index f87a7e7b6e57..36dcbb1d1d56 100644 --- a/gnu/usr.bin/gas/config/obj-aout.c +++ b/gnu/usr.bin/gas/config/obj-aout.c @@ -228,17 +228,23 @@ symbolS *symbol_rootP; temp = S_GET_NAME(symbolP); S_SET_OFFSET(symbolP, symbolP->sy_name_offset); - /* Any symbol still undefined and is not a dbg symbol is made N_EXT. */ - if (!S_IS_DEBUG(symbolP) && !S_IS_DEFINED(symbolP)) - S_SET_EXTERNAL(symbolP); + if (!S_IS_SET(symbolP)) { + /* + * Any symbol still undefined and is not a dbg symbol + * is made N_EXT. + */ + if (!S_IS_DEBUG(symbolP) && !S_IS_DEFINED(symbolP)) + S_SET_EXTERNAL(symbolP); - /* - * Put aux info in lower four bits of `n_other' field - * Do this only now, because things like S_IS_DEFINED() - * depend on S_GET_OTHER() for some unspecified reason. - */ - S_SET_OTHER(symbolP, - (symbolP->sy_bind << 4) | (symbolP->sy_aux & 0xf) ); + /* + * Put aux info in lower four bits of `n_other' field + * Do this only now, because things like S_IS_DEFINED() + * depend on S_GET_OTHER() for some unspecified reason. + */ + S_SET_OTHER(symbolP, + (symbolP->sy_bind << 4) | + (symbolP->sy_aux & 0xf) ); + } if (S_GET_TYPE(symbolP) == N_SIZE) { expressionS *exp = (expressionS*)symbolP->sy_sizexp; @@ -469,10 +475,7 @@ object_headers *headers; /* JF deal with forward references first... */ for (symbolP = symbol_rootP; symbolP; symbolP = symbol_next(symbolP)) { if (symbolP->sy_forward && symbolP->sy_forward != symbolP) { - if (symbolP->sy_symbol.n_type != N_SETA && - symbolP->sy_symbol.n_type != N_SETT && - symbolP->sy_symbol.n_type != N_SETD && - symbolP->sy_symbol.n_type != N_SETB) { + if (!S_IS_SET(symbolP)) { S_SET_SEGMENT(symbolP, S_GET_SEGMENT(symbolP->sy_forward)); if (S_IS_EXTERNAL(symbolP->sy_forward) diff --git a/gnu/usr.bin/gas/config/obj-aout.h b/gnu/usr.bin/gas/config/obj-aout.h index 74d0be276853..76c213e394e8 100644 --- a/gnu/usr.bin/gas/config/obj-aout.h +++ b/gnu/usr.bin/gas/config/obj-aout.h @@ -17,7 +17,7 @@ License along with GAS; see the file COPYING. If not, write to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. - $Id: obj-aout.h,v 1.6 1996/04/14 11:31:54 pk Exp $ + $Id: obj-aout.h,v 1.7 1998/11/24 18:24:31 mycroft Exp $ */ @@ -85,6 +85,11 @@ typedef struct nlist obj_symbol_type; /* Symbol table entry */ #define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT) /* True if the symbol has been generated because of a .stabd directive */ #define S_IS_STABD(s) (S_GET_NAME(s) == (char *)0) +/* True if the symbol is a linker set */ +#define S_IS_SET(s) ((s)->sy_symbol.n_type == N_SETA || \ + (s)->sy_symbol.n_type == N_SETT || \ + (s)->sy_symbol.n_type == N_SETD || \ + (s)->sy_symbol.n_type == N_SETB) /* Accessors */ /* The value of the symbol */