aboutsummaryrefslogtreecommitdiff
path: root/bfd/elf32-v850.c
diff options
context:
space:
mode:
authorNick Clifton <nickc@redhat.com>1999-06-22 02:41:43 +0000
committerNick Clifton <nickc@redhat.com>1999-06-22 02:41:43 +0000
commit232fb1a3f6e27a28b1f011564322f7b4d3b47248 (patch)
tree10a325fcd157d43eea406f99852599e5a5276d81 /bfd/elf32-v850.c
parent69e617ca276f56efec637614aae718ad7b5d4aab (diff)
downloadgdb-232fb1a3f6e27a28b1f011564322f7b4d3b47248.zip
gdb-232fb1a3f6e27a28b1f011564322f7b4d3b47248.tar.gz
gdb-232fb1a3f6e27a28b1f011564322f7b4d3b47248.tar.bz2
Catch overflow in 22_PCREL reloc.
Diffstat (limited to 'bfd/elf32-v850.c')
-rw-r--r--bfd/elf32-v850.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/bfd/elf32-v850.c b/bfd/elf32-v850.c
index 08d4b75..4ca60e8 100644
--- a/bfd/elf32-v850.c
+++ b/bfd/elf32-v850.c
@@ -1369,6 +1369,10 @@ v850_elf_final_link_relocate (howto, input_bfd, output_bfd,
+ input_section->output_offset
+ offset);
+ /* If the sign extension will corrupt the value then we have overflowed. */
+ if (((value & 0xff000000) != 0x0) && ((value & 0xff000000) != 0xff000000))
+ return bfd_reloc_overflow;
+
value = SEXT24 (value); /* Only the bottom 24 bits of the PC are valid */
break;