aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@airs.com>1995-11-09 21:15:10 +0000
committerIan Lance Taylor <ian@airs.com>1995-11-09 21:15:10 +0000
commita9a675966b01b17739c927872b25e6585b209342 (patch)
treed73a6c4e786315319e5508e0403af0e9d743515c
parent922530a691cbb654a1cba0b25f636123f06a4213 (diff)
downloadgdb-a9a675966b01b17739c927872b25e6585b209342.zip
gdb-a9a675966b01b17739c927872b25e6585b209342.tar.gz
gdb-a9a675966b01b17739c927872b25e6585b209342.tar.bz2
* config/tc-a29k.c (md_apply_fix): Warn if an attempt is made to
generate a reloc which the linker will not handle correctly. Fix overflow checking--R_IREL is 18 bits, not 17.
-rw-r--r--gas/config/tc-a29k.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/gas/config/tc-a29k.c b/gas/config/tc-a29k.c
index 015d901..4c24f9e 100644
--- a/gas/config/tc-a29k.c
+++ b/gas/config/tc-a29k.c
@@ -851,11 +851,21 @@ md_apply_fix (fixP, val)
case RELOC_JUMPTARG: /* 00XX00XX pattern in a word */
if (!fixP->fx_done)
- /* let linker deal */
- ;
+ {
+ /* The linker tries to support both AMD and old GNU style
+ R_IREL relocs. That means that if the addend is exactly
+ the negative of the address within the section, the
+ linker will not handle it correctly. */
+ if (fixP->fx_pcrel
+ && val != 0
+ && val == - (fixP->fx_frag->fr_address + fixP->fx_where))
+ as_bad_where
+ (fixP->fx_file, fixP->fx_line,
+ "the linker will not handle this relocation correctly");
+ }
else if (fixP->fx_pcrel)
{
- long v = val >> 16;
+ long v = val >> 17;
if (v != 0 && v != -1)
as_bad_where (fixP->fx_file, fixP->fx_line,
"call/jmp target out of range");