llvm.org GIT mirror llvm / f6cb056
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! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@199287 91177308-0d34-0410-b5e6-96231b3b80d8 Rafael Espindola 6 years ago
2 changed file(s) with 16 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
6767 MipsTargetELFStreamer::MipsTargetELFStreamer() {}
6868
6969 void MipsTargetELFStreamer::emitLabel(MCSymbol *Symbol) {
70 if (!isMicroMipsEnabled())
71 return;
7072 MCSymbolData &Data = getStreamer().getOrCreateSymbolData(Symbol);
73 uint8_t Type = MCELF::GetType(Data);
74 if (Type != ELF::STT_FUNC)
75 return;
76
7177 // The "other" values are stored in the last 6 bits of the second byte
7278 // The traditional defines for STO values assume the full byte and thus
7379 // the shift to pack it.
74 if (isMicroMipsEnabled())
75 MCELF::setOther(Data, ELF::STO_MIPS_MICROMIPS >> 2);
80 MCELF::setOther(Data, ELF::STO_MIPS_MICROMIPS >> 2);
7681 }
7782
7883 MCELFStreamer &MipsTargetELFStreamer::getStreamer() {
11
22
33 .globl f1
4 .type f1, @function
45 .set micromips
56 f1:
67 nop
78
9 .globl d1
10 .type d1, @object
11 d1:
12 .word 42
13
814 .globl f2
15 .type f2, @function
916 .set nomicromips
1017 f2:
1118 nop
1219
20 // CHECK-LABEL: Name: d1
21 // CHECK: Other: 0
1322 // CHECK-LABEL: Name: f1
1423 // CHECK: Other: 128
1524 // CHECK-LABEL: Name: f2