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.