aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorRainer Orth <ro@TechFak.Uni-Bielefeld.DE>2001-07-19 18:08:17 +0000
committerRainer Orth <ro@gcc.gnu.org>2001-07-19 18:08:17 +0000
commit432fa9f208fd1233b2a1c0a48cbf750945217b83 (patch)
tree29f37a4bd9ffd0c7abd0a476ec4b4ae64881e8be /gcc
parentdeaabf1413702dac464e2814ab1d57338a3d686f (diff)
downloadgcc-432fa9f208fd1233b2a1c0a48cbf750945217b83.zip
gcc-432fa9f208fd1233b2a1c0a48cbf750945217b83.tar.gz
gcc-432fa9f208fd1233b2a1c0a48cbf750945217b83.tar.bz2
osf.h (ASM_OUTPUT_WEAK_ALIAS, [...]): Define.
* config/alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL, HANDLE_SYSV_PRAGMA): Define. * mips-tfile.c (add_ext_symbol): Pass complete symbol ptr, inline previous args. (copy_object): Caller changed. testsuite: * g++.old-deja/g++.pt/static3.C: Removed alpha*-*-osf* XFAIL. g++.old-deja/g++.pt/static6.C: Likewise. * lib/target-supports.exp (check_weak_available): alpha*-*-osf* supports weak symbols. From-SVN: r44153
Diffstat (limited to 'gcc')
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/alpha/osf.h23
-rw-r--r--gcc/mips-tfile.c45
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/static3.C2
-rw-r--r--gcc/testsuite/g++.old-deja/g++.pt/static6.C2
-rw-r--r--gcc/testsuite/lib/target-supports.exp7
7 files changed, 63 insertions, 31 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index 61401d1..88ab499 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,3 +1,11 @@
+2001-07-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * config/alpha/osf.h (ASM_OUTPUT_WEAK_ALIAS, ASM_WEAKEN_LABEL,
+ HANDLE_SYSV_PRAGMA): Define.
+ * mips-tfile.c (add_ext_symbol): Pass complete symbol ptr, inline
+ previous args.
+ (copy_object): Caller changed.
+
2001-07-19 Andreas Schwab <schwab@suse.de>
* configure.in (assembler dwarf2 debug_line support): Define nop
diff --git a/gcc/config/alpha/osf.h b/gcc/config/alpha/osf.h
index 24ebaf6..250974c 100644
--- a/gcc/config/alpha/osf.h
+++ b/gcc/config/alpha/osf.h
@@ -186,3 +186,26 @@ __enable_execute_stack (addr) \
(TARGET_GAS \
? (((GLOBAL) ? DW_EH_PE_indirect : 0) | DW_EH_PE_pcrel | DW_EH_PE_sdata4) \
: DW_EH_PE_aligned)
+
+/* This is how we tell the assembler that a symbol is weak. */
+
+#define ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, VALUE) \
+ do \
+ { \
+ ASM_GLOBALIZE_LABEL (FILE, NAME); \
+ fputs ("\t.weakext\t", FILE); \
+ assemble_name (FILE, NAME); \
+ if (VALUE) \
+ { \
+ fputc (' ', FILE); \
+ assemble_name (FILE, VALUE); \
+ } \
+ fputc ('\n', FILE); \
+ } \
+ while (0)
+
+#define ASM_WEAKEN_LABEL(FILE, NAME) ASM_OUTPUT_WEAK_ALIAS(FILE, NAME, 0)
+
+/* Handle #pragma weak and #pragma pack. */
+#undef HANDLE_SYSV_PRAGMA
+#define HANDLE_SYSV_PRAGMA 1
diff --git a/gcc/mips-tfile.c b/gcc/mips-tfile.c
index f28302f..5de540a 100644
--- a/gcc/mips-tfile.c
+++ b/gcc/mips-tfile.c
@@ -1624,13 +1624,8 @@ STATIC symint_t add_local_symbol
symint_t,
symint_t));
-STATIC symint_t add_ext_symbol PARAMS ((const char *,
- const char *,
- st_t,
- sc_t,
- long,
- symint_t,
- int));
+STATIC symint_t add_ext_symbol PARAMS ((EXTR *,
+ int));
STATIC symint_t add_aux_sym_symint
PARAMS ((symint_t));
@@ -2044,23 +2039,24 @@ add_local_symbol (str_start, str_end_p1, type, storage, value, indx)
/* Add an external symbol. */
STATIC symint_t
-add_ext_symbol (str_start, str_end_p1, type, storage, value, indx, ifd)
- const char *str_start; /* first byte in string */
- const char *str_end_p1; /* first byte after string */
- st_t type; /* symbol type */
- sc_t storage; /* storage class */
- long value; /* value of symbol */
- symint_t indx; /* index to local/aux. syms */
+add_ext_symbol (esym, ifd)
+ EXTR *esym; /* symbol pointer */
int ifd; /* file index */
{
+ const char *str_start; /* first byte in string */
+ const char *str_end_p1; /* first byte after string */
register EXTR *psym;
register varray_t *vp = &ext_symbols;
shash_t *hash_ptr = (shash_t *) 0;
+ str_start = ORIG_ESTRS (esym->asym.iss);
+ str_end_p1 = str_start + strlen(str_start);
+
if (debug > 1)
{
- const char *sc_str = sc_to_string (storage);
- const char *st_str = st_to_string (type);
+ long value = esym->asym.value;
+ const char *sc_str = sc_to_string (esym->asym.sc);
+ const char *st_str = st_to_string (esym->asym.st);
fprintf (stderr,
"\tesym\tv= %10ld, ifd= %2d, sc= %-12s",
@@ -2078,11 +2074,9 @@ add_ext_symbol (str_start, str_end_p1, type, storage, value, indx, ifd)
psym = &vp->last->datum->esym[ vp->objects_last_page++ ];
+ *psym = *esym;
psym->ifd = ifd;
- psym->asym.value = value;
- psym->asym.st = (unsigned) type;
- psym->asym.sc = (unsigned) storage;
- psym->asym.index = indx;
+ psym->asym.index = indexNil;
psym->asym.iss = (str_start == (const char *) 0)
? 0
: add_string (&ext_strings,
@@ -4629,17 +4623,10 @@ copy_object ()
for (es = 0; es < orig_sym_hdr.iextMax; es++)
{
register EXTR *eptr = orig_ext_syms + es;
- register char *ename = ORIG_ESTRS (eptr->asym.iss);
register unsigned ifd = eptr->ifd;
- (void) add_ext_symbol (ename,
- ename + strlen (ename),
- (st_t) eptr->asym.st,
- (sc_t) eptr->asym.sc,
- eptr->asym.value,
- (symint_t) indexNil,
- ((long) ifd < orig_sym_hdr.ifdMax
- ? remap_file_number[ifd] : (int) ifd));
+ (void) add_ext_symbol (eptr, ((long) ifd < orig_sym_hdr.ifdMax)
+ ? remap_file_number[ ifd ] : ifd );
}
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 08d1925..c5dd4b2 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,3 +1,10 @@
+2001-07-19 Rainer Orth <ro@TechFak.Uni-Bielefeld.DE>
+
+ * g++.old-deja/g++.pt/static3.C: Removed alpha*-*-osf* XFAIL.
+ g++.old-deja/g++.pt/static6.C: Likewise.
+ * lib/target-supports.exp (check_weak_available): alpha*-*-osf*
+ supports weak symbols.
+
2001-07-18 Andreas Jaeger <aj@suse.de>
* g++.dg/vtgc1.C: Revert patch from 2001-04-26 since vtable-gc is
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static3.C b/gcc/testsuite/g++.old-deja/g++.pt/static3.C
index df770da..bfcfbdb 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/static3.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/static3.C
@@ -1,6 +1,6 @@
// On targets that don't support weak symbols, we require an explicit
// instantiation of arr.
-// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* alpha*-dec-osf* *-*-hms
+// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* *-*-hms
template<class T>
struct A {
diff --git a/gcc/testsuite/g++.old-deja/g++.pt/static6.C b/gcc/testsuite/g++.old-deja/g++.pt/static6.C
index b433e3e..8052dc2 100644
--- a/gcc/testsuite/g++.old-deja/g++.pt/static6.C
+++ b/gcc/testsuite/g++.old-deja/g++.pt/static6.C
@@ -1,5 +1,5 @@
// Build don't run:
-// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* alpha*-dec-osf* *-*-hms
+// excess errors test - XFAIL *-*-aout *-*-coff *-*-hpux* *-*-hms
// Simplified from testcase by Erez Louidor Lior <s3824888@techst02.technion.ac.il>
diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp
index 054fdb8..8664256 100644
--- a/gcc/testsuite/lib/target-supports.exp
+++ b/gcc/testsuite/lib/target-supports.exp
@@ -27,6 +27,7 @@
# this proc returns 1 if they're supported, 0 if they're not, or -1 if unsure
proc check_weak_available { } {
+ global target_triplet
global target_cpu
# All mips targets should support it
@@ -35,6 +36,12 @@ proc check_weak_available { } {
return 1
}
+ # DEC OSF/1/Digital UNIX/Tru64 UNIX supports it
+
+ if { [regexp "alpha.*osf.*" $target_triplet] } {
+ return 1
+ }
+
# ELF and ECOFF support it. a.out does with gas/gld but may also with
# other linkers, so we should try it