From c3b27a64b4e948791421c78d462de240cdba9ced Mon Sep 17 00:00:00 2001 From: Richard Henderson Date: Tue, 27 Jan 1998 13:33:54 +0000 Subject: * as.c (parse_args): Add --keep-locals alias for -L. Add --strip-local-absolute. (show_usage): Update. * as.h (flag_strip_local_absolute): New flag. * symbols.c (S_IS_LOCAL): Use it. * config/obj-aout.h (S_IS_LOCAL): Likewise. * config/obj-bout.h (S_IS_LOCAL): Likewise. * config/obj-coff.h (S_IS_LOCAL): Likewise. PR 14689 --- gas/config/obj-aout.h | 22 +++++++++++++++------- gas/config/obj-bout.h | 13 ++++++++----- gas/config/obj-coff.h | 10 ++++++++-- 3 files changed, 31 insertions(+), 14 deletions(-) (limited to 'gas/config') diff --git a/gas/config/obj-aout.h b/gas/config/obj-aout.h index 537fb19..8940a74 100644 --- a/gas/config/obj-aout.h +++ b/gas/config/obj-aout.h @@ -1,5 +1,6 @@ /* obj-aout.h, a.out object file format for gas, the assembler. - Copyright (C) 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc. + Copyright (C) 1989, 90, 91, 92, 93, 94, 95, 1996 + Free Software Foundation, Inc. This file is part of GAS, the GNU Assembler. @@ -89,7 +90,11 @@ extern void obj_aout_frob_file PARAMS ((void)); #define S_IS_EXTERNAL(s) ((s)->sy_symbol.n_type & N_EXT) /* True if symbol has been defined, ie is in N_{TEXT,DATA,BSS,ABS} or N_EXT */ -#define S_IS_DEFINED(s) ((S_GET_TYPE(s) != N_UNDF) || (S_GET_OTHER(s) != 0) || (S_GET_DESC(s) != 0)) +#define S_IS_DEFINED(s) \ + (S_GET_TYPE (s) != N_UNDF || S_GET_DESC (s) != 0) + +#define S_IS_COMMON(s) \ + (S_GET_TYPE (s) == N_UNDF && S_GET_VALUE (s) != 0) #define S_IS_REGISTER(s) ((s)->sy_symbol.n_type == N_REGISTER) @@ -97,11 +102,14 @@ extern void obj_aout_frob_file PARAMS ((void)); #define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB) /* True if a symbol is local symbol name */ #define S_IS_LOCAL(s) \ - (S_GET_NAME (s) \ - && !S_IS_DEBUG (s) \ - && (strchr (S_GET_NAME (s), '\001') != NULL \ - || strchr (S_GET_NAME (s), '\002') != NULL \ - || (S_LOCAL_NAME(s) && !flag_keep_locals))) + ((S_GET_NAME (s) \ + && !S_IS_DEBUG (s) \ + && (strchr (S_GET_NAME (s), '\001') != NULL \ + || strchr (S_GET_NAME (s), '\002') != NULL \ + || (S_LOCAL_NAME(s) && !flag_keep_locals))) \ + || (flag_strip_local_absolute \ + && ! S_IS_EXTERNAL(s) \ + && S_GET_SEGMENT == absolute_section)) /* True if a symbol is not defined in this file */ #define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT) /* True if the symbol has been generated because of a .stabd directive */ diff --git a/gas/config/obj-bout.h b/gas/config/obj-bout.h index dddb19f..ec539a0 100644 --- a/gas/config/obj-bout.h +++ b/gas/config/obj-bout.h @@ -192,11 +192,14 @@ struct relocation_info #define S_IS_DEBUG(s) ((s)->sy_symbol.n_type & N_STAB) /* True if a symbol is local symbol name */ #define S_IS_LOCAL(s) \ - (S_GET_NAME (s) \ - && !S_IS_DEBUG (s) \ - && (strchr (S_GET_NAME (s), '\001') != NULL \ - || strchr (S_GET_NAME (s), '\002') != NULL \ - || (S_LOCAL_NAME(s) && !flag_keep_locals))) + ((S_GET_NAME (s) \ + && !S_IS_DEBUG (s) \ + && (strchr (S_GET_NAME (s), '\001') != NULL \ + || strchr (S_GET_NAME (s), '\002') != NULL \ + || (S_LOCAL_NAME(s) && !flag_keep_locals))) \ + || (flag_strip_local_absolute \ + && !S_IS_EXTERNAL(s) \ + && S_GET_SEGMENT(s) == absolute_section)) /* True if a symbol is not defined in this file */ #define S_IS_EXTERN(s) ((s)->sy_symbol.n_type & N_EXT) /* True if the symbol has been generated because of a .stabd directive */ diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index 8ab4b09..ed41cd0 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -111,7 +111,10 @@ #ifdef TC_SH #include "coff/sh.h" -#define TARGET_FORMAT (shl ? "coff-shl" : "coff-sh") +#define TARGET_FORMAT \ + (shl \ + ? (sh_small ? "coff-shl-small" : "coff-shl") \ + : (sh_small ? "coff-sh-small" : "coff-sh")) #endif #ifdef TC_M88K @@ -451,7 +454,10 @@ typedef struct ((s)->sy_symbol.ost_entry.n_scnum == C_REGISTER_SECTION \ || (S_LOCAL_NAME(s) && ! flag_keep_locals && ! S_IS_DEBUG (s)) \ || strchr (S_GET_NAME (s), '\001') != NULL \ - || strchr (S_GET_NAME (s), '\002') != NULL) + || strchr (S_GET_NAME (s), '\002') != NULL \ + || (flag_strip_local_absolute \ + && !S_IS_EXTERNAL(s) \ + && (s)->sy_symbol.ost_entry.n_scnum == C_ABS_SECTION)) /* True if a symbol is not defined in this file */ #define S_IS_EXTERN(s) ((s)->sy_symbol.ost_entry.n_scnum == 0 \ && S_GET_VALUE (s) == 0) -- cgit v1.1