[lld] r259744 - Set S_ATTR_SOME_INSTRUCTIONS on __text section.
Pete Cooper via llvm-commits
llvm-commits at lists.llvm.org
Wed Feb 3 18:23:35 PST 2016
Author: pete
Date: Wed Feb 3 20:23:34 2016
New Revision: 259744
URL: http://llvm.org/viewvc/llvm-project?rev=259744&view=rev
Log:
Set S_ATTR_SOME_INSTRUCTIONS on __text section.
ld64 sets both S_ATTR_PURE_INSTRUCTIONS and S_ATTR_SOME_INSTRUCTIONS
on __TEXT, __text. We only had the S_ATTR_PURE_INSTRUCTIONS attribute.
rdar://problem/24495801
Added:
lld/trunk/test/mach-o/sectattrs.yaml
Modified:
lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
Modified: lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp?rev=259744&r1=259743&r2=259744&view=diff
==============================================================================
--- lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp (original)
+++ lld/trunk/lib/ReaderWriter/MachO/MachONormalizedFileFromAtoms.cpp Wed Feb 3 20:23:34 2016
@@ -302,7 +302,7 @@ SectionInfo *Util::getFinalSection(Defin
case DefinedAtom::typeCode:
case DefinedAtom::typeStub:
case DefinedAtom::typeStubHelper:
- sectionAttrs = S_ATTR_PURE_INSTRUCTIONS;
+ sectionAttrs = S_ATTR_PURE_INSTRUCTIONS | S_ATTR_SOME_INSTRUCTIONS;
break;
case DefinedAtom::typeThunkTLV:
_hasTLVDescriptors = true;
Added: lld/trunk/test/mach-o/sectattrs.yaml
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/test/mach-o/sectattrs.yaml?rev=259744&view=auto
==============================================================================
--- lld/trunk/test/mach-o/sectattrs.yaml (added)
+++ lld/trunk/test/mach-o/sectattrs.yaml Wed Feb 3 20:23:34 2016
@@ -0,0 +1,30 @@
+# RUN: lld -flavor darwin -arch x86_64 -macosx_version_min 10.8 %s -dylib \
+# RUN: %p/Inputs/libSystem.yaml -o %t \
+# RUN: && llvm-objdump -private-headers %t | FileCheck %s
+#
+
+--- !mach-o
+arch: x86_64
+file-type: MH_OBJECT
+flags: [ MH_SUBSECTIONS_VIA_SYMBOLS ]
+sections:
+ - segment: __TEXT
+ section: __text
+ type: S_REGULAR
+ attributes: [ ]
+ address: 0x0000000000000000
+ content: [ 0x55, 0x48, 0x89, 0xE5, 0x8B, 0x05, 0x00, 0x00,
+ 0x00, 0x00, 0x03, 0x05, 0x00, 0x00, 0x00, 0x00,
+ 0x5D, 0xC3 ]
+global-symbols:
+ - name: _get
+ type: N_SECT
+ scope: [ N_EXT ]
+ sect: 1
+ value: 0x0000000000000000
+
+...
+
+
+# CHECK: PURE_INSTRUCTIONS SOME_INSTRUCTIONS
+
More information about the llvm-commits
mailing list