[llvm] r199287 - Only mark functions as micromips.
Richard Sandiford
rsandifo at linux.vnet.ibm.com
Wed Jan 15 06:28:01 PST 2014
Rafael Espindola <rafael.espindola at gmail.com> writes:
> Only mark functions as micromips.
>
> The GNU as behavior is a bit different and very strange. It will mark any
> label that contains an instruction. We can implement that, but using the
> type looks more natural since gas will not mark a function if a .word is
> used to output the instructions!
Careful! It's important that all "instruction" labels get marked as
micromips, even if they have no explicit type. E.g. if you have:
.set micromips
.type foo, @function
.ent foo
foo:
nop
my_label:
nop
.end foo
then my_label must be treated as micromips:
Symbol table '.symtab' contains 8 entries:
Num: Value Size Type Bind Vis Ndx Name
0: 00000000 0 NOTYPE LOCAL DEFAULT UND
1: 00000000 0 SECTION LOCAL DEFAULT 1 .text
2: 00000000 0 SECTION LOCAL DEFAULT 2 .data
3: 00000000 0 SECTION LOCAL DEFAULT 3 .bss
4: 00000000 0 SECTION LOCAL DEFAULT 4 .reginfo
5: 00000000 0 SECTION LOCAL DEFAULT 5 .pdr
6: 00000000 4 FUNC LOCAL DEFAULT [MICROMIPS] 1 foo
7: 00000002 0 NOTYPE LOCAL DEFAULT [MICROMIPS] 1 my_label
It looked from the patch like this wouldn't happen.
This is important for things like EH tables, debug info, or other such data,
as well as for alternative entry points.
The syntax for forcing a label to be treated as an instruction label
is ".insn". So:
f2:
.insn
.word ...
can be used to emit instructions as .words.
I strongly suggest not doing something different for LLVM. This stuff
is hairy enough as it is without having two different interpretations
of the same assembly.
Thanks,
Richard
More information about the llvm-commits
mailing list