This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |
| Other format: | [Raw text] | |
Hi everyone. I came across this while fixing a gcc testsuite regression
on this same target. Basically, lo/hi16 relocs were being bogusly checked
to see if the entire addend would fit into 16 bits, when after all it can be
a full 32 bits. Lines of code like this:
lhi r1,%hi(.L1 + 200000)
ori r1,r0,%lo(.L1 + 200000)
produced incorrect error messages like this:
/gnu/src/gas/testsuite/gas/dlx/lohi.s:5: Error: value of 200004 too large
for field of 2 bytes at 6
/gnu/src/gas/testsuite/gas/dlx/lohi.s:6: Error: value of 200004 too large
for field of 2 bytes at 10
Looking at it slightly closer, it turns out that the DLX assembler wasn't
ever generating lo16 relocs, but was emitting standard 16-bit relocs
instead.
The attached patch fixes this problem. With this patch, range checking is
turned off for hi/lo16 relocs; and a %lo operator generates a lo16 reloc,
while referring to a label directly as an operand generates an ordinary
16bit reloc as before. There's also a testcase for the bug and necessary
updates to the other testcases that use %lo. Passes make check with no
regressions. It should be a small enough fix for assignment not to be an
issue.
2004-03-06 Dave Korn <dk@artimi.com>
gas/config/
* tc-dlx.c (md_assemble): set fx_no_overflow flag for
hi16 and lo16 fixS structs.
(md_assemble): generate bit_fixS for RELOC_DLX_LO16 in
exactly the same way as for RELOC_DLX_REL16.
(machine_ip): properly respect LO flag in the_insn and
output RELOC_DLX_LO16 rather than RELOC_DLX_16.
(md_apply_fix3): apply RELOC_DLX_LO16.
gas/testsuite/gas/
* alltests.exp: execute new lohi test.
* lohi.d, lohi.s: new test for spurious lo16/hi16
reloc overflow checking.
* itype.d, lhi.d: updated to properly expect lo16
relocations where asked for.
* lhi.d: corrected cut+paste error in test name.
cheers,
DaveK
--
Can't think of a witty .sigline today....
Attachment:
gas-diff.txt
Description: Text document
| Index Nav: | [Date Index] [Subject Index] [Author Index] [Thread Index] | |
|---|---|---|
| Message Nav: | [Date Prev] [Date Next] | [Thread Prev] [Thread Next] |