[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug gas/27254] New: Wrong operand for SADDR (rl78)
From: |
lenvampir at yandex dot ru |
Subject: |
[Bug gas/27254] New: Wrong operand for SADDR (rl78) |
Date: |
Wed, 27 Jan 2021 07:29:08 +0000 |
https://sourceware.org/bugzilla/show_bug.cgi?id=27254
Bug ID: 27254
Summary: Wrong operand for SADDR (rl78)
Product: binutils
Version: 2.36
Status: UNCONFIRMED
Severity: normal
Priority: P2
Component: gas
Assignee: unassigned at sourceware dot org
Reporter: lenvampir at yandex dot ru
Target Milestone: ---
Created attachment 13164
--> https://sourceware.org/bugzilla/attachment.cgi?id=13164&action=edit
Examples showing the bug
For the RL78 processor, the operand for the SADDR type is calculated
incorrectly. The specification says that SADDR starts with 0xFFE20 and the same
number is used in the RANGE check on the line above, but then the operand is
calculated incorrectly.
case R_RL78_RH_SADDR:
RANGE (0xffe20, 0xfff1f);
OP (0) = relocation & 0xff;
break;
File binutils/bfd/elf32-rl78.c, line 924.
I think the correct code looks like this
case R_RL78_RH_SADDR:
RANGE (0xffe20, 0xfff1f);
OP (0) = (relocation - 0x20) & 0xff;
break;
Attached is an archive with files showing the error.
In this piece (main function from saddr_bin_objdump.txt):
00002195 <_main>:
2195: f6 clrw ax
2196: bd 20 movw 0xffe20, ax
2198: d7 ret
The instruction bd 20 is output as movw 0xFFe20, but should be bd 00 (see
Figure 2.1 and 4.2.4 official documentation).
P.S. Unfortunately, I could not find a link to the file from the official
documentation, the points are indicated by the file that I have on disk.
--
You are receiving this mail because:
You are on the CC list for the bug.
- [Bug gas/27254] New: Wrong operand for SADDR (rl78),
lenvampir at yandex dot ru <=