From 6341b0a419ffb947d0c865091f0bb626dff7581c Mon Sep 17 00:00:00 2001 From: aoliva Date: Thu, 27 Nov 2003 02:30:55 +0000 Subject: [PATCH] * config/tc-frv.c (md_pcrel_from_section): Don't adjust when referencing symbol in a different section. --- gas/ChangeLog | 5 +++++ gas/config/tc-frv.c | 15 +++++++++++---- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/gas/ChangeLog b/gas/ChangeLog index 7fd7be5065..a5c7f401ee 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,8 @@ +2003-11-27 Alexandre Oliva + + * config/tc-frv.c (md_pcrel_from_section): Don't adjust when + referencing symbol in a different section. + 2003-11-26 Christian Groessler * config/tc-z8k.c (s_segm): Fix indentation. diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c index 4bc8aec377..85503cd900 100644 --- a/gas/config/tc-frv.c +++ b/gas/config/tc-frv.c @@ -1265,11 +1265,18 @@ md_convert_frag (abfd, sec, fragP) long md_pcrel_from_section (fixP, sec) fixS * fixP; - segT sec ATTRIBUTE_UNUSED; + segT sec; { - /* Make no adjustment for relocations that will be written out. */ - if (TC_FORCE_RELOCATION (fixP)) - return 0; + if (TC_FORCE_RELOCATION (fixP) + || (fixP->fx_addsy != (symbolS *) NULL + && S_GET_SEGMENT (fixP->fx_addsy) != sec)) + { + /* If we can't adjust this relocation, or if it references a + local symbol in a different section (which + TC_FORCE_RELOCATION can't check), let the linker figure it + out. */ + return 0; + } return (fixP->fx_frag->fr_address + fixP->fx_where) & ~1; } -- 2.11.0