diff options
author | Stephane Carrez <stcarrez@nerim.fr> | 2001-01-11 19:42:47 +0000 |
---|---|---|
committer | Stephane Carrez <stcarrez@nerim.fr> | 2001-01-11 19:42:47 +0000 |
commit | d8273f3bf31a2982d64c8d4dd49bba59090f55d9 (patch) | |
tree | f1e3cf5b2d41ed581b6cb64f1c5f229c3adca395 | |
parent | 2f6d2f85201f21b07cbfd501a9d78576fc2f91d9 (diff) | |
download | ppe42-binutils-d8273f3bf31a2982d64c8d4dd49bba59090f55d9.tar.gz ppe42-binutils-d8273f3bf31a2982d64c8d4dd49bba59090f55d9.zip |
Fix weak symbols for 68HC11 as
-rw-r--r-- | gas/ChangeLog | 6 | ||||
-rw-r--r-- | gas/config/tc-m68hc11.c | 27 |
2 files changed, 27 insertions, 6 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 55c624d0a8..d9a5dd9116 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,9 @@ +2001-01-11 Stephane Carrez <Stephane.Carrez@worldnet.fr> + + * config/tc-m68hc11.c (md_estimate_size_before_relax):Don't + relax weak symbols. + (relaxable_symbol): New function. + 2001-01-11 Andreas Jaeger <aj@suse.de> * config/tc-i386.h (TC_RELOC_GLOBAL_OFFSET_TABLE): Removed, it's diff --git a/gas/config/tc-m68hc11.c b/gas/config/tc-m68hc11.c index 81311084c4..4bbaaac9c7 100644 --- a/gas/config/tc-m68hc11.c +++ b/gas/config/tc-m68hc11.c @@ -1,5 +1,5 @@ /* tc-m68hc11.c -- Assembler code for the Motorola 68HC11 & 68HC12. - Copyright (C) 1999, 2000 Free Software Foundation. + Copyright (C) 1999, 2000, 2001 Free Software Foundation. Written by Stephane Carrez (stcarrez@worldnet.fr) This file is part of GAS, the GNU Assembler. @@ -2527,6 +2527,16 @@ md_convert_frag (abfd, sec, fragP) } } +/* On an ELF system, we can't relax an externally visible symbol, + as well as a weak symbol. The weak symbol can be overriden + at final link time by a non weak symbol. */ +static int +relaxable_symbol (symbol) + symbolS* symbol; +{ + return ! S_IS_EXTERNAL (symbol) && ! S_IS_WEAK (symbol); +} + /* Force truly undefined symbols to their maximum size, and generally set up the frag list to be relaxed. */ int @@ -2549,7 +2559,8 @@ md_estimate_size_before_relax (fragP, segment) || IS_OPCODE (fragP->fr_opcode[0], M6812_BSR)); /* A relaxable case. */ - if (S_GET_SEGMENT (fragP->fr_symbol) == segment) + if (S_GET_SEGMENT (fragP->fr_symbol) == segment + && relaxable_symbol (fragP->fr_symbol)) { fragP->fr_subtype = ENCODE_RELAX (STATE_PC_RELATIVE, STATE_BYTE); } @@ -2575,7 +2586,8 @@ md_estimate_size_before_relax (fragP, segment) case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_UNDF): assert (current_architecture & cpu6811); - if (S_GET_SEGMENT (fragP->fr_symbol) == segment) + if (S_GET_SEGMENT (fragP->fr_symbol) == segment + && relaxable_symbol (fragP->fr_symbol)) { fragP->fr_subtype = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH, STATE_BYTE); @@ -2600,7 +2612,8 @@ md_estimate_size_before_relax (fragP, segment) case ENCODE_RELAX (STATE_INDEXED_OFFSET, STATE_UNDF): assert (current_architecture & cpu6812); - if (S_GET_SEGMENT (fragP->fr_symbol) == segment) + if (S_GET_SEGMENT (fragP->fr_symbol) == segment + && relaxable_symbol (fragP->fr_symbol)) { fragP->fr_subtype = ENCODE_RELAX (STATE_INDEXED_OFFSET, STATE_BITS5); @@ -2622,7 +2635,8 @@ md_estimate_size_before_relax (fragP, segment) case ENCODE_RELAX (STATE_XBCC_BRANCH, STATE_UNDF): assert (current_architecture & cpu6812); - if (S_GET_SEGMENT (fragP->fr_symbol) == segment) + if (S_GET_SEGMENT (fragP->fr_symbol) == segment + && relaxable_symbol (fragP->fr_symbol)) { fragP->fr_subtype = ENCODE_RELAX (STATE_XBCC_BRANCH, STATE_BYTE); } @@ -2646,7 +2660,8 @@ md_estimate_size_before_relax (fragP, segment) case ENCODE_RELAX (STATE_CONDITIONAL_BRANCH_6812, STATE_UNDF): assert (current_architecture & cpu6812); - if (S_GET_SEGMENT (fragP->fr_symbol) == segment) + if (S_GET_SEGMENT (fragP->fr_symbol) == segment + && relaxable_symbol (fragP->fr_symbol)) { fragP->fr_subtype = ENCODE_RELAX (STATE_CONDITIONAL_BRANCH_6812, STATE_BYTE); |