2021-03-18 Christian Groessler <chris@groessler.org>

* config/tc-z8k.c (apply_fix): Handle 7-bit relocations correctly.
       Problem found by Tadashi G. Takaoka <tadashi.g.takaoka@gmail.com>.
This commit is contained in:
Christian Groessler
2021-03-18 21:33:51 +01:00
parent 15310fd4eb
commit 3273f9a19e
2 changed files with 31 additions and 16 deletions

View File

@ -1,3 +1,8 @@
2021-03-18 Christian Groessler <chris@groessler.org>
* config/tc-z8k.c (apply_fix): Handle 7-bit relocations correctly.
Problem found by Tadashi G. Takaoka <tadashi.g.takaoka@gmail.com>.
2021-03-16 Kuan-Lin Chen <kuanlinchentw@gmail.com>
* config/tc-riscv.c (ext_version_table): Add b, zba, zbb and zbc.

View File

@ -993,6 +993,15 @@ apply_fix (unsigned char *ptr, bfd_reloc_code_real_type type,
/* size is in nibbles. */
newfix ((ptr - buffer) / 2, type, size + 1, operand);
if (type == BFD_RELOC_Z8K_DISP7)
{
/* 2 nibbles, but most significant bit is part of the opcode == 7 bits. */
*ptr++ = (n >> 4) & 7;
*ptr++ = n >> 0;
}
else
{
switch (size)
{
case 8: /* 8 nibbles == 32 bits. */
@ -1012,6 +1021,7 @@ apply_fix (unsigned char *ptr, bfd_reloc_code_real_type type,
*ptr++ = n >> 0;
break;
}
}
return ptr;
}