forked from OSchip/llvm-project
llvm-nm should show a symbol type of T for symbols in the (__TEXT_EXEC,__text) section.
When a the Apple link editor builds a kext bundle file type and the value of the -miphoneos-version-min argument is significantly current (like 11.0) then the (__TEXT,__text) section is changed to the (__TEXT_EXEC,__text) section. So it would be nice for llvm-nm to show symbols in that section with a type of T instead of the generic type of S for some section other than text, data, etc. rdar://36262205 llvm-svn: 323836
This commit is contained in:
parent
db6c993faf
commit
b95a050b98
Binary file not shown.
|
@ -0,0 +1,2 @@
|
||||||
|
if not 'AArch64' in config.root.targets:
|
||||||
|
config.unsupported = True
|
|
@ -0,0 +1,4 @@
|
||||||
|
RUN: llvm-nm %p/Inputs/kextbundle.macho-aarch64 | FileCheck %s
|
||||||
|
|
||||||
|
CHECK: 0000000000004014 s _bar.stub
|
||||||
|
CHECK: 0000000000004000 T _foo
|
|
@ -1004,6 +1004,10 @@ static char getSymbolNMTypeChar(MachOObjectFile &Obj, basic_symbol_iterator I) {
|
||||||
StringRef SectionName;
|
StringRef SectionName;
|
||||||
Obj.getSectionName(Ref, SectionName);
|
Obj.getSectionName(Ref, SectionName);
|
||||||
StringRef SegmentName = Obj.getSectionFinalSegmentName(Ref);
|
StringRef SegmentName = Obj.getSectionFinalSegmentName(Ref);
|
||||||
|
if (Obj.is64Bit() &&
|
||||||
|
Obj.getHeader64().filetype == MachO::MH_KEXT_BUNDLE &&
|
||||||
|
SegmentName == "__TEXT_EXEC" && SectionName == "__text")
|
||||||
|
return 't';
|
||||||
if (SegmentName == "__TEXT" && SectionName == "__text")
|
if (SegmentName == "__TEXT" && SectionName == "__text")
|
||||||
return 't';
|
return 't';
|
||||||
if (SegmentName == "__DATA" && SectionName == "__data")
|
if (SegmentName == "__DATA" && SectionName == "__data")
|
||||||
|
|
Loading…
Reference in New Issue