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]

Re: binutils is broken for Linux/sh


There's two ways to fix this, pick your favorite:

Choice a) is to do the standard "make a separate table for the read/write portion and use that" I did for the other assemblers and disassemblers.

Choice b) is to remove the requirement that the "name" portion of the table have the same address if the strings are equal. This invariant isn't used in tc-mcore.c; in tc-sh.c, it's used as an optimization in the opcode search to speed up the check for "have we switched to an opcode with a different name".

I propose that we go with b), and just change the one compare to a compare followed by a streq. In the worst-case, this should be a relatively insignificant inefficiency. But my guess is that the worst-case would never happen, as all the strings are constant strings declared in the same header, and should end up assigned to the same address anyway.

If we go with choice b), here's the patch:

Attachment: more-const.txt
Description: Text document



Both targets (mcore-elf, sh-elf) are tested and pass the test-suite clean.

On Thursday, November 21, 2002, at 02:35 AM, Alan Modra wrote:

On Wed, Nov 20, 2002 at 03:42:31PM -0800, H. J. Lu wrote:
I got so many
[snip errors]

Yeah, the assembler is bombing at tc-sh.c:893 due to the opcode table
constification.

--
Alan Modra
IBM OzLabs - Linux Technology Centre


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]