Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1295)

Side by Side Diff: lib/Target/X86/X86TargetObjectFile.cpp

Issue 939073008: Rebased PNaCl localmods in LLVM to 223109 (Closed)
Patch Set: undo localmod Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « lib/Target/X86/X86TargetObjectFile.h ('k') | lib/Transforms/CMakeLists.txt » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 //===-- X86TargetObjectFile.cpp - X86 Object Info -------------------------===// 1 //===-- X86TargetObjectFile.cpp - X86 Object Info -------------------------===//
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 "X86TargetObjectFile.h" 10 #include "X86TargetObjectFile.h"
11 #include "X86Subtarget.h" // @LOCALMOD
11 #include "llvm/ADT/StringExtras.h" 12 #include "llvm/ADT/StringExtras.h"
12 #include "llvm/IR/Mangler.h" 13 #include "llvm/IR/Mangler.h"
13 #include "llvm/IR/Operator.h" 14 #include "llvm/IR/Operator.h"
14 #include "llvm/MC/MCContext.h" 15 #include "llvm/MC/MCContext.h"
15 #include "llvm/MC/MCExpr.h" 16 #include "llvm/MC/MCExpr.h"
16 #include "llvm/MC/MCSectionCOFF.h" 17 #include "llvm/MC/MCSectionCOFF.h"
17 #include "llvm/MC/MCSectionELF.h" 18 #include "llvm/MC/MCSectionELF.h"
18 #include "llvm/Support/Dwarf.h" 19 #include "llvm/Support/Dwarf.h"
19 #include "llvm/Target/TargetLowering.h" 20 #include "llvm/Target/TargetLowering.h"
20 21
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 COFF::IMAGE_SCN_LNK_COMDAT; 163 COFF::IMAGE_SCN_LNK_COMDAT;
163 return getContext().getCOFFSection(".rdata", Characteristics, Kind, 164 return getContext().getCOFFSection(".rdata", Characteristics, Kind,
164 COMDATSymName, 165 COMDATSymName,
165 COFF::IMAGE_COMDAT_SELECT_ANY); 166 COFF::IMAGE_COMDAT_SELECT_ANY);
166 } 167 }
167 } 168 }
168 } 169 }
169 170
170 return TargetLoweringObjectFile::getSectionForConstant(Kind, C); 171 return TargetLoweringObjectFile::getSectionForConstant(Kind, C);
171 } 172 }
173
174 // @LOCALMOD-START
175 // NOTE: this was largely lifted from
176 // lib/Target/ARM/ARMTargetObjectFile.cpp
177 //
178 // The default is .ctors/.dtors while the arm backend uses
179 // .init_array/.fini_array
180 //
181 // Without this the linker defined symbols __fini_array_start and
182 // __fini_array_end do not have useful values. c.f.:
183 // http://code.google.com/p/nativeclient/issues/detail?id=805
184 void TargetLoweringObjectFileNaCl::Initialize(MCContext &Ctx,
185 const TargetMachine &TM) {
186 TargetLoweringObjectFileELF::Initialize(Ctx, TM);
187
188 StaticCtorSection =
189 getContext().getELFSection(".init_array", ELF::SHT_INIT_ARRAY,
190 ELF::SHF_WRITE |
191 ELF::SHF_ALLOC,
192 SectionKind::getDataRel());
193 StaticDtorSection =
194 getContext().getELFSection(".fini_array", ELF::SHT_FINI_ARRAY,
195 ELF::SHF_WRITE |
196 ELF::SHF_ALLOC,
197 SectionKind::getDataRel());
198 }
199 // @LOCALMOD-END
OLDNEW
« no previous file with comments | « lib/Target/X86/X86TargetObjectFile.h ('k') | lib/Transforms/CMakeLists.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698