This is the mail archive of the binutils@sourceware.org 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: [PATCH] Only warn when missing MIPS LO16 are encountered



Not without altering the program semantics, I would have thought.

The problem is, %hi16 without %lo16 has no defined semantics, so there aren't really any semantics to change. I don't think...


Agreed.


At the moment, these can only arise through 1) faulty compiler 2)
hand-coded assembly. If we silently turn them into nops, we don't get
any warning that the compiler has emitted bad code. If the user has
hand-coded one, they probably have some idea what they mean by it, and
would probably like the assembler to interpret it according to
least-surprise.

...hand-coding an orphaned %hi16 is really a reasonable thing to do.


How about HJ's suggestion?  Would there be any problem with getting
gas to drop orphaned %hi16s, with an appropriate warning?  (And doing
it in addition to whatever the linker eventually does?)  The warning
could be under option control, so it could be turned off by -Werror
users.  FWIW, I think warning in the assembler would help gcc testers,
because it would also pick up problems in non-link tests.

I think this sounds like the best idea.


-eric


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