OLD | NEW |
1 //===- lib/MC/MCNaCl.cpp - NaCl-specific MC implementation ----------------===// | 1 //===- lib/MC/MCNaCl.cpp - NaCl-specific MC implementation ----------------===// |
2 // | 2 // |
3 // The LLVM Compiler Infrastructure | 3 // The LLVM Compiler Infrastructure |
4 // | 4 // |
5 // This file is distributed under the University of Illinois Open Source | 5 // This file is distributed under the University of Illinois Open Source |
6 // License. See LICENSE.TXT for details. | 6 // License. See LICENSE.TXT for details. |
7 // | 7 // |
8 //===----------------------------------------------------------------------===// | 8 //===----------------------------------------------------------------------===// |
9 | 9 |
10 #include "llvm/MC/MCNaCl.h" | 10 #include "llvm/MC/MCNaCl.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 // For gas, override the size of DWARF address values generated by .loc | 56 // For gas, override the size of DWARF address values generated by .loc |
57 // directives. | 57 // directives. |
58 if (TheTriple.getArch() == Triple::x86_64 && | 58 if (TheTriple.getArch() == Triple::x86_64 && |
59 Streamer.hasRawTextSupport()) { | 59 Streamer.hasRawTextSupport()) { |
60 Streamer.EmitRawText("\t.dwarf_addr_size 4\n"); | 60 Streamer.EmitRawText("\t.dwarf_addr_size 4\n"); |
61 } | 61 } |
62 // Emit an ELF Note section in its own COMDAT group which identifies NaCl | 62 // Emit an ELF Note section in its own COMDAT group which identifies NaCl |
63 // object files to the gold linker, so it can use the NaCl layout. | 63 // object files to the gold linker, so it can use the NaCl layout. |
64 const MCSection *Note = Ctx.getELFSection( | 64 const MCSection *Note = Ctx.getELFSection( |
65 NoteName, ELF::SHT_NOTE, ELF::SHF_ALLOC | ELF::SHF_GROUP, | 65 NoteName, ELF::SHT_NOTE, ELF::SHF_ALLOC | ELF::SHF_GROUP, 0, NoteName); |
66 SectionKind::getReadOnly(), 0, NoteName); | |
67 | 66 |
68 Streamer.PushSection(); | 67 Streamer.PushSection(); |
69 Streamer.SwitchSection(Note); | 68 Streamer.SwitchSection(Note); |
70 Streamer.EmitIntValue(strlen(NoteNamespace) + 1, 4); | 69 Streamer.EmitIntValue(strlen(NoteNamespace) + 1, 4); |
71 Streamer.EmitIntValue(strlen(NoteArch) + 1, 4); | 70 Streamer.EmitIntValue(strlen(NoteArch) + 1, 4); |
72 Streamer.EmitIntValue(ELF::NT_VERSION, 4); | 71 Streamer.EmitIntValue(ELF::NT_VERSION, 4); |
73 Streamer.EmitBytes(NoteNamespace); | 72 Streamer.EmitBytes(NoteNamespace); |
74 Streamer.EmitIntValue(0, 1); // NUL terminator | 73 Streamer.EmitIntValue(0, 1); // NUL terminator |
75 Streamer.EmitValueToAlignment(4); | 74 Streamer.EmitValueToAlignment(4); |
76 Streamer.EmitBytes(NoteArch); | 75 Streamer.EmitBytes(NoteArch); |
77 Streamer.EmitIntValue(0, 1); // NUL terminator | 76 Streamer.EmitIntValue(0, 1); // NUL terminator |
78 Streamer.EmitValueToAlignment(4); | 77 Streamer.EmitValueToAlignment(4); |
79 Streamer.PopSection(); | 78 Streamer.PopSection(); |
80 } | 79 } |
81 | 80 |
82 } // namespace llvm | 81 } // namespace llvm |
OLD | NEW |