c-pragma.h (HANDLE_PRAGMA_WEAK): Define if ASM_WEAKEN_DECL too.

* c-pragma.h (HANDLE_PRAGMA_WEAK): Define if ASM_WEAKEN_DECL too.
        * config/rs6000/linux64.h (ASM_DECLARE_FUNCTION_NAME): Don't emit
        .weak for code sym.  Do emit .size for descriptor sym.
        (ASM_DECLARE_FUNCTION_SIZE): Define.
        * config/rs6000/rs6000.h (ASM_WEAKEN_DECL): Define.
        (ASM_OUTPUT_DEF_FROM_DECLS): Don't emit .weak here.  Don't output
        .lglobl unless TARGET_XCOFF.  Formatting fixes.
        (PREDICATE_CODES): Add any_operand and zero_constant.
        (HANDLE_PRAGMA_PACK): Delete.
        * config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Don't emit
        .weak for code sym.
        (HANDLE_PRAGMA_WEAK): Remove.
        (ASM_WEAKEN_LABEL): Remove.
        (COLLECT_EXPORT_LIST): Delete.
        * config/rs6000/aix.h (HANDLE_SYSV_PRAGMA): Define.
        * config/rs6000/darwin.h (HANDLE_SYSV_PRAGMA): Define.

Co-Authored-By: David Edelsohn <edelsohn@gnu.org>

From-SVN: r50987
This commit is contained in:
Alan Modra 2002-03-18 19:16:18 +00:00 committed by David Edelsohn
parent 970b15bd62
commit 2aac7e342a
8 changed files with 126 additions and 88 deletions

View File

@ -1,3 +1,23 @@
2002-03-18 Alan Modra <amodra@bigpond.net.au>
David Edelsohn <edelsohn@gnu.org>
* c-pragma.h (HANDLE_PRAGMA_WEAK): Define if ASM_WEAKEN_DECL too.
* config/rs6000/linux64.h (ASM_DECLARE_FUNCTION_NAME): Don't emit
.weak for code sym. Do emit .size for descriptor sym.
(ASM_DECLARE_FUNCTION_SIZE): Define.
* config/rs6000/rs6000.h (ASM_WEAKEN_DECL): Define.
(ASM_OUTPUT_DEF_FROM_DECLS): Don't emit .weak here. Don't output
.lglobl unless TARGET_XCOFF. Formatting fixes.
(PREDICATE_CODES): Add any_operand and zero_constant.
(HANDLE_PRAGMA_PACK): Delete.
* config/rs6000/xcoff.h (ASM_DECLARE_FUNCTION_NAME): Don't emit
.weak for code sym.
(HANDLE_PRAGMA_WEAK): Remove.
(ASM_WEAKEN_LABEL): Remove.
(COLLECT_EXPORT_LIST): Delete.
* config/rs6000/aix.h (HANDLE_SYSV_PRAGMA): Define.
* config/rs6000/darwin.h (HANDLE_SYSV_PRAGMA): Define.
2002-03-18 Bob Wilson <bob.wilson@acm.org>
* config/xtensa/xtensa.h (GO_IF_MODE_DEPENDENT_ADDRESS): Treat

View File

@ -1,5 +1,5 @@
/* Handle #pragma, system V.4 style. Supports #pragma weak and #pragma pack.
Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001
Copyright (C) 1992, 1997, 1998, 1999, 2000, 2001, 2002
Free Software Foundation, Inc.
This file is part of GCC.

View File

@ -23,9 +23,8 @@ Software Foundation, 59 Temple Place - Suite 330, Boston, MA
#define GCC_C_PRAGMA_H
#ifdef HANDLE_SYSV_PRAGMA
/* Support #pragma weak iff ASM_WEAKEN_LABEL and ASM_OUTPUT_WEAK_ALIAS are
defined. */
#if defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_WEAK_ALIAS)
#if ((defined (ASM_WEAKEN_LABEL) && defined (ASM_OUTPUT_WEAK_ALIAS)) \
|| defined (ASM_WEAKEN_DECL))
#define HANDLE_PRAGMA_WEAK SUPPORTS_WEAK
#endif

View File

@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for IBM RS/6000 POWER running AIX.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@ -27,6 +27,9 @@ Boston, MA 02111-1307, USA. */
collect has a chance to see them, so scan the object files directly. */
#define COLLECT_EXPORT_LIST
/* Handle #pragma weak and #pragma pack. */
#define HANDLE_SYSV_PRAGMA
/* This is the only version of nm that collect2 can work with. */
#define REAL_NM_FILE_NAME "/usr/ucb/nm"

View File

@ -35,6 +35,9 @@ Boston, MA 02111-1307, USA. */
#define TARGET_TOC 0
#define TARGET_NO_TOC 1
/* Handle #pragma weak and #pragma pack. */
#define HANDLE_SYSV_PRAGMA
/* The Darwin ABI always includes AltiVec, can't be (validly) turned
off. */
@ -221,6 +224,7 @@ Boston, MA 02111-1307, USA. */
: (TARGET_ALTIVEC && TREE_CODE (STRUCT) == VECTOR_TYPE) \
? MAX (MAX ((COMPUTED), (SPECIFIED)), 128) \
: MAX ((COMPUTED), (SPECIFIED)))
/* XXX: Darwin supports neither .quad, or .llong, but it also doesn't
support 64 bit powerpc either, so this just keeps things happy. */
#define DOUBLE_INT_ASM_OP "\t.quad\t"

View File

@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for 64 bit powerpc linux.
Copyright (C) 2000, 2001 Free Software Foundation, Inc.
Copyright (C) 2000, 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@ -250,32 +250,39 @@ do { \
fputs (DOUBLE_INT_ASM_OP, (FILE)); \
putc ('.', (FILE)); \
assemble_name ((FILE), (NAME)); \
putc ('\n', (FILE)); \
fputs (DOUBLE_INT_ASM_OP, (FILE)); \
fputs (".TOC.@tocbase, 0\n\t.previous\n", (FILE)); \
\
if (TREE_PUBLIC (DECL)) \
fputs (",.TOC.@tocbase,0\n\t.previous\n\t.size\t", (FILE)); \
assemble_name ((FILE), (NAME)); \
fputs (",24\n\t.type\t.", (FILE)); \
assemble_name ((FILE), (NAME)); \
fputs (",@function\n", (FILE)); \
if (TREE_PUBLIC (DECL) && ! DECL_WEAK (DECL)) \
{ \
if (DECL_WEAK (DECL)) \
fputs ("\t.weak\t", (FILE)); \
else \
fputs ("\t.globl\t", (FILE)); \
putc ('.', (FILE)); \
fputs ("\t.globl\t.", (FILE)); \
assemble_name ((FILE), (NAME)); \
putc ('\n', (FILE)); \
} \
fputs (TYPE_ASM_OP, (FILE)); \
putc ('.', (FILE)); \
assemble_name ((FILE), (NAME)); \
putc (',', (FILE)); \
fprintf ((FILE), TYPE_OPERAND_FMT, "function"); \
putc ('\n', (FILE)); \
ASM_DECLARE_RESULT ((FILE), DECL_RESULT (DECL)); \
putc ('.', (FILE)); \
ASM_OUTPUT_LABEL ((FILE), (NAME)); \
} \
while (0)
/* This is how to declare the size of a function. */
#undef ASM_DECLARE_FUNCTION_SIZE
#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \
do \
{ \
if (!flag_inhibit_size_directive) \
{ \
fputs ("\t.size\t.", (FILE)); \
assemble_name ((FILE), (FNAME)); \
fputs (",.-.", (FILE)); \
assemble_name ((FILE), (FNAME)); \
putc ('\n', (FILE)); \
} \
} \
while (0)
/* Return non-zero if this entry is to be written into the constant
pool in a special way. We do so if this is a SYMBOL_REF, LABEL_REF
or a CONST containing one of them. If -mfp-in-toc (the default),

View File

@ -626,9 +626,6 @@ extern int rs6000_altivec_abi;
#define LOCAL_ALIGNMENT(TYPE, ALIGN) \
((TARGET_ALTIVEC && TREE_CODE (TYPE) == VECTOR_TYPE) ? 128 : ALIGN)
/* Handle #pragma pack. */
#define HANDLE_PRAGMA_PACK 1
/* Alignment of field after `int : 0' in a structure. */
#define EMPTY_FIELD_BOUNDARY 32
@ -2430,43 +2427,71 @@ extern int toc_initialized;
#define RS6000_WEAK 0
#endif
/* This implementes the `alias' attribute. */
#define ASM_OUTPUT_DEF_FROM_DECLS(FILE,decl,target) \
do { \
const char * alias = XSTR (XEXP (DECL_RTL (decl), 0), 0); \
const char * name = IDENTIFIER_POINTER (target); \
if (TREE_CODE (decl) == FUNCTION_DECL \
&& DEFAULT_ABI == ABI_AIX) \
{ \
if (TREE_PUBLIC (decl)) \
{ \
if (RS6000_WEAK && DECL_WEAK (decl)) \
{ \
fputs ("\t.weak .", FILE); \
assemble_name (FILE, alias); \
putc ('\n', FILE); \
} \
else \
{ \
fputs ("\t.globl .", FILE); \
assemble_name (FILE, alias); \
putc ('\n', FILE); \
} \
} \
else \
{ \
fputs ("\t.lglobl .", FILE); \
assemble_name (FILE, alias); \
putc ('\n', FILE); \
} \
fputs ("\t.set .", FILE); \
assemble_name (FILE, alias); \
fputs (",.", FILE); \
assemble_name (FILE, name); \
fputc ('\n', FILE); \
} \
ASM_OUTPUT_DEF (FILE, alias, name); \
} while (0)
#if RS6000_WEAK
/* Used in lieu of ASM_WEAKEN_LABEL. */
#define ASM_WEAKEN_DECL(FILE, DECL, NAME, VAL) \
do \
{ \
fputs ("\t.weak\t", (FILE)); \
assemble_name ((FILE), (NAME)); \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL \
&& DEFAULT_ABI == ABI_AIX) \
{ \
fputs ("\n\t.weak\t.", (FILE)); \
assemble_name ((FILE), (NAME)); \
} \
fputc ('\n', (FILE)); \
if (VAL) \
{ \
ASM_OUTPUT_DEF ((FILE), (NAME), (VAL)); \
if ((DECL) && TREE_CODE (DECL) == FUNCTION_DECL \
&& DEFAULT_ABI == ABI_AIX) \
{ \
fputs ("\t.set\t.", (FILE)); \
assemble_name ((FILE), (NAME)); \
fputs (",.", (FILE)); \
assemble_name ((FILE), (VAL)); \
fputc ('\n', (FILE)); \
} \
} \
} \
while (0)
#endif
/* This implements the `alias' attribute. */
#undef ASM_OUTPUT_DEF_FROM_DECLS
#define ASM_OUTPUT_DEF_FROM_DECLS(FILE, DECL, TARGET) \
do \
{ \
const char *alias = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \
const char *name = IDENTIFIER_POINTER (TARGET); \
if (TREE_CODE (DECL) == FUNCTION_DECL \
&& DEFAULT_ABI == ABI_AIX) \
{ \
if (TREE_PUBLIC (DECL)) \
{ \
if (!RS6000_WEAK || !DECL_WEAK (DECL)) \
{ \
fputs ("\t.globl\t.", FILE); \
assemble_name (FILE, alias); \
putc ('\n', FILE); \
} \
} \
else if (TARGET_XCOFF) \
{ \
fputs ("\t.lglobl\t.", FILE); \
assemble_name (FILE, alias); \
putc ('\n', FILE); \
} \
fputs ("\t.set\t.", FILE); \
assemble_name (FILE, alias); \
fputs (",.", FILE); \
assemble_name (FILE, name); \
fputc ('\n', FILE); \
} \
ASM_OUTPUT_DEF (FILE, alias, name); \
} \
while (0)
/* Output to assembler file text saying following lines
may contain character constants, extra white space, comments, etc. */
@ -2721,6 +2746,10 @@ extern char rs6000_reg_names[][8]; /* register names (0 vs. %r0). */
/* Define the codes that are matched by predicates in rs6000.c. */
#define PREDICATE_CODES \
{"any_operand", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \
LABEL_REF, SUBREG, REG, MEM, PARALLEL}}, \
{"zero_constant", {CONST_INT, CONST_DOUBLE, CONST, SYMBOL_REF, \
LABEL_REF, SUBREG, REG, MEM}}, \
{"short_cint_operand", {CONST_INT}}, \
{"u_short_cint_operand", {CONST_INT}}, \
{"non_short_cint_operand", {CONST_INT}}, \

View File

@ -1,6 +1,6 @@
/* Definitions of target machine for GNU compiler,
for some generic XCOFF file format
Copyright (C) 2001 Free Software Foundation, Inc.
Copyright (C) 2001, 2002 Free Software Foundation, Inc.
This file is part of GNU CC.
@ -22,10 +22,6 @@ Boston, MA 02111-1307, USA. */
#define TARGET_OBJECT_FORMAT OBJECT_XCOFF
/* The AIX linker will discard static constructors in object files before
collect has a chance to see them, so scan the object files directly. */
#define COLLECT_EXPORT_LIST
/* The RS/6000 uses the XCOFF format. */
#define XCOFF_DEBUGGING_INFO
@ -345,13 +341,7 @@ toc_section () \
SYMBOL_REF_FLAG (sym_ref) = 1; \
if (TREE_PUBLIC (DECL)) \
{ \
if (RS6000_WEAK && DECL_WEAK (decl)) \
{ \
fputs ("\t.weak .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
putc ('\n', FILE); \
} \
else \
if (!RS6000_WEAK || !DECL_WEAK (decl)) \
{ \
fputs ("\t.globl .", FILE); \
RS6000_OUTPUT_BASENAME (FILE, NAME); \
@ -464,20 +454,6 @@ toc_section () \
xcoff_bss_section_name); \
} while (0)
/* Output a weak symbol, if weak support present. */
#ifdef HAVE_GAS_WEAK
#define HANDLE_PRAGMA_WEAK 1
#define ASM_WEAKEN_LABEL(FILE, NAME) \
do \
{ \
fputs ("\t.weak ", (FILE)); \
assemble_name ((FILE), (NAME)); \
fputc ('\n', (FILE)); \
} \
while (0)
#endif /* HAVE_GAS_WEAK */
/* This is how we tell the assembler that two symbols have the same value. */
#define SET_ASM_OP "\t.set "