diff options
author | Claudiu Zissulescu <claziss@synopsys.com> | 2016-04-05 17:05:09 +0200 |
---|---|---|
committer | Claudiu Zissulescu <claziss@synopsys.com> | 2016-04-05 17:05:09 +0200 |
commit | 094fb06395d03ac343d1ce14a3621d1b4f78a0cc (patch) | |
tree | a439b93416a8abf080fbf5ed7d2bd871034adff9 /include | |
parent | 589a7d88306628fb332ba0a98ac4a4b3b84b7b2c (diff) | |
download | gdb-094fb06395d03ac343d1ce14a3621d1b4f78a0cc.zip gdb-094fb06395d03ac343d1ce14a3621d1b4f78a0cc.tar.gz gdb-094fb06395d03ac343d1ce14a3621d1b4f78a0cc.tar.bz2 |
[ARC] 24 bit reloc and overflow detection fix.
bfd/
2016-04-05 Cupertino Miranda <cmiranda@synopsys.com>
* elf32-arc.c (name_for_global_symbol): Changed assert.
(get_replace_function): Created.:
(struct arc_relocation_data): Changed to signed types.
(defines S, L, P, PDATA): Casted to signed type.
(defines SECTSTART, _SDA_BASE_, TLS_REL): Likewise.
(PRINT_DEBUG_RELOC_INFO_BEFORE): Changed.
(arc_do_relocation): Changed.
include/
2016-04-05 Cupertino Miranda <cmiranda@synopsys.com>
* opcode/arc-func.h (replace_bits24): Changed.
(replace_bits24_be): Created.
Diffstat (limited to 'include')
-rw-r--r-- | include/ChangeLog | 5 | ||||
-rw-r--r-- | include/opcode/arc-func.h | 17 |
2 files changed, 21 insertions, 1 deletions
diff --git a/include/ChangeLog b/include/ChangeLog index 874088d..755c014 100644 --- a/include/ChangeLog +++ b/include/ChangeLog @@ -1,3 +1,8 @@ +2016-04-05 Cupertino Miranda <cmiranda@synopsys.com> + + * opcode/arc-func.h (replace_bits24): Changed. + (replace_bits24_be): Created. + 2016-03-29 Claudiu Zissulescu <claziss@synopsys.com> * opcode/arc.h (insn_subclass_t): Add QUARKSE subclass. diff --git a/include/opcode/arc-func.h b/include/opcode/arc-func.h index 47451a6..cafb92f 100644 --- a/include/opcode/arc-func.h +++ b/include/opcode/arc-func.h @@ -66,13 +66,28 @@ replace_bits16 (unsigned insn, int value ATTRIBUTE_UNUSED) ATTRIBUTE_UNUSED static unsigned replace_bits24 (unsigned insn, int value ATTRIBUTE_UNUSED) { + insn = insn & ~0xffffff; + insn |= ((value >> 0) & 0xffffff) << 0; + + return insn; +} + +#endif /* REPLACE_bits24 */ + +/* Special 24 bit replace for big endian. */ +/* mask = 111111111111111111111111. */ +#ifndef REPLACE_bits24_be +#define REPLACE_bits24_be +ATTRIBUTE_UNUSED static unsigned +replace_bits24_be (unsigned insn, int value ATTRIBUTE_UNUSED) +{ insn = insn & ~0xffffff00; insn |= ((value >> 0) & 0xffffff) << 8; return insn; } -#endif /* REPLACE_bits24 */ +#endif /* REPLACE_bits24_be */ /* mask = 11111111111111111111111111111111. */ #ifndef REPLACE_word32 |