The generic ELF TargetObjectFile defaults to .ctors, but Linux's
defaults to .init_array by calling InitializeELF with the value of
UseInitArray from TargetMachine. Make NaCl's behavior match.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
looks okay -- a couple nits
lib/Target/X86/X86TargetMachine.cpp | ||
---|---|---|
41 ↗ | (On Diff #21664) | nit: the class is called "Linux" but now it applies to Linux and NaCl. I wonder if the the X86ELFTargetObjectFile and X86Linux should just be merged. It's kind of odd in terms of naming that the X86ELFTargetObjectFile doesn't call InitializeELF =) The fact that some systems use ctors and others use init_array is supposed to be controlled by the TM.Options.UseInitArray not so much whether InitializeELF is called or not. On the other hand, I'm not sure if clang sets that option correctly for each user of ELF + X86, so that might be a reason to check that as a separate change. |
test/CodeGen/X86/constructor.ll | ||
33 ↗ | (On Diff #21664) | nit: Can these be NACL-NEXT for uniformity? |