Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRichard Sandiford <rdsandiford@googlemail.com>2009-03-14 12:34:26 +0300
committerRichard Sandiford <rdsandiford@googlemail.com>2009-03-14 12:34:26 +0300
commit443e66934ca57d3fc521e4fa5062842b383ee14a (patch)
tree4d5fd4d04b6e7b49333c4d52d474cf5c722aa1e9 /include/coff
parent07aa5b7d9e446f70a7c18af7c6f39c88311319d3 (diff)
include/coff/
* internal.h (C_AIX_WEAKEXT): New macro. (C_WEAKEXT): Use the GNU definition in the generic part of the file, and conditionally reset it to C_AIX_WEAKEXT in the XCOFF part of the file. (CSECT_SYM_P): New macro. * xcoff.h (L_WEAK): Define. (EXTERN_SYM_P): New macro. bfd/ * coffcode.h (coff_pointerize_aux_hook): Update CSECT_SYM_P to check whether a symbol has csect information. (coff_print_aux): Likewise. * coff-rs6000.c (_bfd_xcoff_swap_aux_in): Handle auxillary csect information for C_AIX_WEAKEXT too. (_bfd_xcoff_swap_aux_out): Likewise. (xcoff_reloc_type_br): Handle defweak symbols too. * coff64-rs6000.c (_bfd_xcoff64_swap_aux_in): Handle auxillary csect information for C_AIX_WEAKEXT too. (_bfd_xcoff64_swap_aux_out): Likewise. (xcoff64_reloc_type_br): Handle defweak symbols too. * coffgen.c (coff_print_symbol): Handle auxillary function information for C_AIX_WEAKEXT too. * xcofflink.c (_bfd_xcoff_canonicalize_dynamic_symtab): Set BSF_WEAK instead of BSF_GLOBAL if the L_WEAK flag is set. (xcoff_dynamic_definition_p): New function. (xcoff_link_add_dynamic_symbols): Use it to decide whether ldsym defines h. Don't change h if ldsym isn't the definition. Otherwise, always take the symbol class from the ldsym. Use weak bfd symbol types for weak ldsyms. (xcoff_link_add_symbols): Use CSECT_SYM_P and EXTERN_SYM_P. Fix the check for whether a definition is from a shared object. Allow redefinitions of weak symbols. (xcoff_link_check_ar_symbols): Use EXTERN_SYM_P. (xcoff_keep_symbol_p): Likewise. (bfd_xcoff_size_dynamic_sections): Use CSECT_SYM_P. (xcoff_link_input_bfd): Use CSECT_SYM_P and EXTERN_SYM_P. Add .loader entries for C_AIX_WEAKEXT as well as C_EXT symbols, but mark them as L_WEAK. (xcoff_write_global_symbol): Treat weak symbols as C_AIX_WEAKEXT instead of C_EXT if C_AIX_WEAKEXT == C_WEAKEXT. gas/ * config/tc-ppc.c (ppc_frob_symbol): Add csect information for C_AIX_WEAKEXT too. ld/testsuite/ * ld-powerpc/aix-glink-2a.s, ld-powerpc/aix-glink-2a.ex, ld-powerpc/aix-glink-2b.s, ld-powerpc/aix-glink-2c.s, ld-powerpc/aix-glink-2c.ex, ld-powerpc/aix-glink-2d.s, ld-powerpc/aix-glink-2-32.dd, ld-powerpc/aix-glink-2-64.dd, ld-powerpc/aix-weak-1a.s, ld-powerpc/aix-weak-1b.s, ld-powerpc/aix-weak-1-rel.hd, ld-powerpc/aix-weak-1-rel.nd, ld-powerpc/aix-weak-1-dso.hd, ld-powerpc/aix-weak-1-dso.nd, ld-powerpc/aix-weak-1-dso.dnd, ld-powerpc/aix-weak-1.ex, ld-powerpc/aix-weak-2a.s, ld-powerpc/aix-weak-2a.ex, ld-powerpc/aix-weak-2a.nd, ld-powerpc/aix-weak-2b.s, ld-powerpc/aix-weak-2b.nd, ld-powerpc/aix-weak-2c.s, ld-powerpc/aix-weak-2c.ex, ld-powerpc/aix-weak-2c.nd, ld-powerpc/aix-weak-2c.od, ld-powerpc/aix-weak-3a.s, ld-powerpc/aix-weak-3a.ex, ld-powerpc/aix-weak-3b.s, ld-powerpc/aix-weak-3b.ex, ld-powerpc/aix-weak-3-32.d, ld-powerpc/aix-weak-3-32.dd, ld-powerpc/aix-weak-3-64.d, ld-powerpc/aix-weak-3-64.dd: New tests. * ld-powerpc/aix52.exp: Run them. Replace tmp/aix-* with tmp/aix64-* in 64-bit ld options.
Diffstat (limited to 'include/coff')
-rw-r--r--include/coff/ChangeLog10
-rw-r--r--include/coff/internal.h15
-rw-r--r--include/coff/xcoff.h6
3 files changed, 26 insertions, 5 deletions
diff --git a/include/coff/ChangeLog b/include/coff/ChangeLog
index d96ae1ca1..09cd87322 100644
--- a/include/coff/ChangeLog
+++ b/include/coff/ChangeLog
@@ -1,5 +1,15 @@
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
+ * internal.h (C_AIX_WEAKEXT): New macro.
+ (C_WEAKEXT): Use the GNU definition in the generic part of the file,
+ and conditionally reset it to C_AIX_WEAKEXT in the XCOFF part of
+ the file.
+ (CSECT_SYM_P): New macro.
+ * xcoff.h (L_WEAK): Define.
+ (EXTERN_SYM_P): New macro.
+
+2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
+
* xcoff.h (XCOFF_ALLOCATED): New flag.
2009-03-14 Richard Sandiford <r.sandiford@uk.ibm.com>
diff --git a/include/coff/internal.h b/include/coff/internal.h
index 2c9ae46c5..c5d6cd1fc 100644
--- a/include/coff/internal.h
+++ b/include/coff/internal.h
@@ -273,12 +273,7 @@ struct internal_aouthdr
#define C_LINE 104 /* line # reformatted as symbol table entry */
#define C_ALIAS 105 /* duplicate tag */
#define C_HIDDEN 106 /* ext symbol in dmert public lib */
-
-#if defined _AIX52 || defined AIX_WEAK_SUPPORT
-#define C_WEAKEXT 111 /* weak symbol -- AIX standard. */
-#else
#define C_WEAKEXT 127 /* weak symbol -- GNU extension. */
-#endif
/* New storage classes for TI COFF */
#define C_UEXT 19 /* Tentative external definition */
@@ -311,6 +306,12 @@ struct internal_aouthdr
#define C_HIDEXT 107 /* Un-named external symbol */
#define C_BINCL 108 /* Marks beginning of include file */
#define C_EINCL 109 /* Marks ending of include file */
+#define C_AIX_WEAKEXT 111 /* AIX definition of C_WEAKEXT. */
+
+#if defined _AIX52 || defined AIX_WEAK_SUPPORT
+#undef C_WEAKEXT
+#define C_WEAKEXT C_AIX_WEAKEXT
+#endif
/* storage classes for stab symbols for RS/6000 */
#define C_GSYM (0x80)
@@ -336,6 +337,10 @@ struct internal_aouthdr
#define C_THUMBEXTFUNC (C_THUMBEXT + 20) /* 150 */
#define C_THUMBSTATFUNC (C_THUMBSTAT + 20) /* 151 */
+/* True if XCOFF symbols of class CLASS have auxillary csect information. */
+#define CSECT_SYM_P(CLASS) \
+ ((CLASS) == C_EXT || (CLASS) == C_AIX_WEAKEXT || (CLASS) == C_HIDEXT)
+
/********************** SECTION HEADER **********************/
#define SCNNMLEN (8)
diff --git a/include/coff/xcoff.h b/include/coff/xcoff.h
index 3c3c8e9ea..4f9f7edee 100644
--- a/include/coff/xcoff.h
+++ b/include/coff/xcoff.h
@@ -214,6 +214,8 @@ struct internal_ldsym
#define L_ENTRY (0x20)
/* Exported symbol. */
#define L_EXPORT (0x10)
+/* Weak symbol. */
+#define L_WEAK (0x08)
/* The ldrel structure. This is used to represent a reloc in the
.loader section. */
@@ -644,4 +646,8 @@ struct xcoff_ar_hdr_big
#define arch_xhdr_big(bfd) \
((struct xcoff_ar_hdr_big *) arch_eltdata (bfd)->arch_header)
+/* True if symbols of class CLASS are external. */
+#define EXTERN_SYM_P(CLASS) \
+ ((CLASS) == C_EXT || (CLASS) == C_AIX_WEAKEXT)
+
#endif /* _INTERNAL_XCOFF_H */