From 1f5d13edbfaf8a9e3e27a4bb9d82683beb244c94 Mon Sep 17 00:00:00 2001 From: geoffk Date: Mon, 31 Jan 2000 19:13:47 +0000 Subject: [PATCH] * config/obj-coff.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Don't define if already defined. * config/tc-ppc.h [OBJ_XCOFF] (OBJ_COPY_SYMBOL_ATTRIBUTES): New macro. * config/tc-ppc.c (ppc_fix_adjustable): Don't look at the frag of a symbol when we really care about its value. --- gas/ChangeLog | 11 ++++++++++- gas/config/obj-coff.h | 2 ++ gas/config/tc-ppc.c | 8 ++++---- gas/config/tc-ppc.h | 16 +++++++++++++++- 4 files changed, 31 insertions(+), 6 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 4ad9880ebe..57b55e00f3 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,4 +1,13 @@ -2000-19-01 Chandra Chavva +2000-01-31 Geoff Keating + + * config/obj-coff.h (OBJ_COPY_SYMBOL_ATTRIBUTES): Don't define if + already defined. + * config/tc-ppc.h [OBJ_XCOFF] (OBJ_COPY_SYMBOL_ATTRIBUTES): + New macro. + * config/tc-ppc.c (ppc_fix_adjustable): Don't look at the frag + of a symbol when we really care about its value. + +2000-01-19 Chandra Chavva * config/tc-mcore.c (md_assemble): Give warning message if operands passes to instruction are more than the spec. diff --git a/gas/config/obj-coff.h b/gas/config/obj-coff.h index 5e7642bcf5..a616872801 100644 --- a/gas/config/obj-coff.h +++ b/gas/config/obj-coff.h @@ -371,6 +371,7 @@ extern symbolS *coff_last_function; /* Forward the segment of a forwarded symbol, handle assignments that just copy symbol values, etc. */ +#ifndef OBJ_COPY_SYMBOL_ATTRIBUTES #ifndef TE_I386AIX #define OBJ_COPY_SYMBOL_ATTRIBUTES(dest,src) \ (SF_GET_GET_SEGMENT (dest) \ @@ -382,6 +383,7 @@ extern symbolS *coff_last_function; ? (S_SET_SEGMENT (dest, S_GET_SEGMENT (src)), 0) \ : 0) #endif +#endif /* sanity check */ diff --git a/gas/config/tc-ppc.c b/gas/config/tc-ppc.c index c18a274793..25844a5fae 100644 --- a/gas/config/tc-ppc.c +++ b/gas/config/tc-ppc.c @@ -1,5 +1,6 @@ /* tc-ppc.c -- Assemble for the PowerPC or POWER (RS/6000) - Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -4556,14 +4557,13 @@ ppc_fix_adjustable (fix) { while (symbol_get_tc (csect)->next != (symbolS *) NULL && (symbol_get_frag (symbol_get_tc (csect)->next)->fr_address - <= symbol_get_frag (fix->fx_addsy)->fr_address)) + <= val)) { /* If the csect address equals the symbol value, then we have to look through the full symbol table to see whether this is the csect we want. Note that we will only get here if the csect has zero length. */ - if ((symbol_get_frag (csect)->fr_address - == symbol_get_frag (fix->fx_addsy)->fr_address) + if ((symbol_get_frag (csect)->fr_address == val) && S_GET_VALUE (csect) == S_GET_VALUE (fix->fx_addsy)) { symbolS *scan; diff --git a/gas/config/tc-ppc.h b/gas/config/tc-ppc.h index 436b975f69..783a215d9e 100644 --- a/gas/config/tc-ppc.h +++ b/gas/config/tc-ppc.h @@ -1,5 +1,6 @@ /* tc-ppc.h -- Header file for tc-ppc.c. - Copyright (C) 1994, 95, 96, 97, 98, 1999 Free Software Foundation, Inc. + Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000 + Free Software Foundation, Inc. Written by Ian Lance Taylor, Cygnus Support. This file is part of GAS, the GNU Assembler. @@ -187,6 +188,19 @@ extern void ppc_adjust_symtab PARAMS ((void)); /* Niclas Andersson says this is needed. */ #define SUB_SEGMENT_ALIGN(SEG) 2 +/* We also need to copy, in particular, the class of the symbol, + over what obj-coff would otherwise have copied. */ +#define OBJ_COPY_SYMBOL_ATTRIBUTES(dest,src) \ +do { \ + if (SF_GET_GET_SEGMENT (dest)) \ + S_SET_SEGMENT (dest, S_GET_SEGMENT (src)); \ + symbol_get_tc (dest)->size = symbol_get_tc (src)->size; \ + symbol_get_tc (dest)->align = symbol_get_tc (src)->align; \ + symbol_get_tc (dest)->class = symbol_get_tc (src)->class; \ + symbol_get_tc (dest)->within = symbol_get_tc (src)->within; \ +} while (0) + + #endif /* OBJ_XCOFF */ #ifdef OBJ_ELF -- 2.11.0