aboutsummaryrefslogtreecommitdiff
path: root/gas/config/tc-cris.c
diff options
context:
space:
mode:
authorAlan Modra <amodra@gmail.com>2002-09-05 00:01:18 +0000
committerAlan Modra <amodra@gmail.com>2002-09-05 00:01:18 +0000
commita161fe53205dbc69d42f5a123b2b04346724b2de (patch)
treebb28dde4f0deee90db9e7a8247fb82dd2e4933fe /gas/config/tc-cris.c
parent8f8429869e9a245fe48b8c69bde2bffa3d6c7734 (diff)
downloadgdb-a161fe53205dbc69d42f5a123b2b04346724b2de.zip
gdb-a161fe53205dbc69d42f5a123b2b04346724b2de.tar.gz
gdb-a161fe53205dbc69d42f5a123b2b04346724b2de.tar.bz2
gas reloc rewrite.
Diffstat (limited to 'gas/config/tc-cris.c')
-rw-r--r--gas/config/tc-cris.c29
1 files changed, 10 insertions, 19 deletions
diff --git a/gas/config/tc-cris.c b/gas/config/tc-cris.c
index b5e9527..e41b467 100644
--- a/gas/config/tc-cris.c
+++ b/gas/config/tc-cris.c
@@ -1,5 +1,5 @@
/* tc-cris.c -- Assembler code for the CRIS CPU core.
- Copyright 2000, 2001 Free Software Foundation, Inc.
+ Copyright 2000, 2001, 2002 Free Software Foundation, Inc.
Contributed by Axis Communications AB, Lund, Sweden.
Originally written for GAS 1.38.1 by Mikael Asker.
@@ -2895,10 +2895,8 @@ tc_gen_reloc (section, fixP)
relP->address = fixP->fx_frag->fr_address + fixP->fx_where;
if (fixP->fx_pcrel)
- /* FIXME: Is this correct? */
- relP->addend = fixP->fx_addnumber;
+ relP->addend = 0;
else
- /* At least *this one* is correct. */
relP->addend = fixP->fx_offset;
/* This is the standard place for KLUDGEs to work around bugs in
@@ -2994,17 +2992,10 @@ md_apply_fix3 (fixP, valP, seg)
}
else
{
- /* I took this from tc-arc.c, since we used to not support
- fx_subsy != NULL. I'm not totally sure it's TRT. */
+ /* We can't actually support subtracting a symbol. */
if (fixP->fx_subsy != (symbolS *) NULL)
- {
- if (S_GET_SEGMENT (fixP->fx_subsy) == absolute_section)
- val -= S_GET_VALUE (fixP->fx_subsy);
- else
- /* We can't actually support subtracting a symbol. */
- as_bad_where (fixP->fx_file, fixP->fx_line,
- _("expression too complex"));
- }
+ as_bad_where (fixP->fx_file, fixP->fx_line,
+ _("expression too complex"));
cris_number_to_imm (buf, val, fixP->fx_size, fixP, seg);
}
@@ -3042,10 +3033,10 @@ md_undefined_symbol (name)
return 0;
}
-/* Definition of TC_FORCE_RELOCATION.
- FIXME: Unsure of this. Can we omit it? Just copied from tc-i386.c
- when doing multi-object format with ELF, since it's the only other
- multi-object-format target with a.out and ELF. */
+/* If this function returns non-zero, it prevents the relocation
+ against symbol(s) in the FIXP from being replaced with relocations
+ against section symbols, and guarantees that a relocation will be
+ emitted even when the value can be resolved locally. */
int
md_cris_force_relocation (fixp)
struct fix *fixp;
@@ -3066,7 +3057,7 @@ md_cris_force_relocation (fixp)
;
}
- return 0;
+ return S_FORCE_RELOC (fixp->fx_addsy);
}
/* Check and emit error if broken-word handling has failed to fix up a