aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-frv.c
diff options
context:
space:
mode:
authorAlexandre Oliva <aoliva@redhat.com>2003-11-27 02:30:55 +0000
committerAlexandre Oliva <aoliva@redhat.com>2003-11-27 02:30:55 +0000
commita939d0907fbdef8618e17afbdd728bf817235d5a (patch)
treec1f3aa6762c10a19aad5dfec3a470cd7ca816da1 /gas/config/tc-frv.c
parentb49dc2a10967778768c61be018ff8ad2dcf131a8 (diff)
downloadgdb-a939d0907fbdef8618e17afbdd728bf817235d5a.zip
gdb-a939d0907fbdef8618e17afbdd728bf817235d5a.tar.gz
gdb-a939d0907fbdef8618e17afbdd728bf817235d5a.tar.bz2
* config/tc-frv.c (md_pcrel_from_section): Don't adjust when
referencing symbol in a different section.
Diffstat (limited to 'gas/config/tc-frv.c')
-rw-r--r--gas/config/tc-frv.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/gas/config/tc-frv.c b/gas/config/tc-frv.c
index 4bc8aec..85503cd 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;
}