From 77db8e2e96ba37bb1915261d21f7287f15b67bf8 Mon Sep 17 00:00:00 2001 From: Nick Clifton Date: Thu, 29 Apr 2010 14:44:15 +0000 Subject: * write.c (fixup_segment): Do not assume we know the section a defined weak symbol is in. * config/tc-arm.c (relax_adr, relax_branch, md_apply_fix): Treat weak symbols as not known to be in the same section, even if they are defined. * gas/arm/weakdef-1.s: New. * gas/arm/weakdef-1.d: New. * gas/arm/weakdef-2.s: New. * gas/arm/weakdef-2.d: New. * gas/arm/weakdef-2.l: New. --- gas/write.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'gas/write.c') diff --git a/gas/write.c b/gas/write.c index a148b24..b50b0d4 100644 --- a/gas/write.c +++ b/gas/write.c @@ -992,7 +992,9 @@ fixup_segment (fixS *fixP, segT this_segment) if (fixP->fx_addsy) { - if (add_symbol_segment == this_segment + if (S_IS_WEAK (fixP->fx_addsy)) + ; // even if it is defined, it might be overridden later + else if (add_symbol_segment == this_segment && !TC_FORCE_RELOCATION_LOCAL (fixP)) { /* This fixup was made when the symbol's segment was -- cgit v1.1