llvm.org GIT mirror llvm / 37104ff
[llvm-nm] Print 'I' for import table data in COFF The character gets uppercased into 'I' when it's a global symbol. In GNU binutils, nm prints 'I' for symbols classified by bfd_is_ind_section - which probably isn't exactly/only import tables. When building for win32, (some incarnations of?) libtool has got rules that try to inspect linked libraries, and in order to be sure that it is linking to a DLL import library as opposed to a static library, it expects to find the string " I " in the output of $NM when run on such an import library. GNU binutils nm also flags all of the .idata$X chunks as 'i' (while this patch only makes it set on .idata$2 and .idata$6) and also flags __imp__function as 'I'. Differential Revision: https://reviews.llvm.org/D39540 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@317300 91177308-0d34-0410-b5e6-96231b3b80d8 Martin Storsjo 1 year, 11 months ago
2 changed file(s) with 6 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
0 # RUN: llvm-nm -B %S/Inputs/example.lib | FileCheck --match-full-lines %s
2 CHECK: 00000000 I __IMPORT_DESCRIPTOR_example
24 CHECK: 00000000 R __imp__constant
35 CHECK: 00000000 R _constant
46 CHECK: 00000000 D __imp__data
945945 section_iterator SecI = *SecIOrErr;
946946 const coff_section *Section = Obj.getCOFFSection(*SecI);
947947 Characteristics = Section->Characteristics;
948 StringRef SectionName;
949 Obj.getSectionName(Section, SectionName);
950 if (SectionName.startswith(".idata"))
951 return 'i';
948952 }
950954 switch (Symb.getSectionNumber()) {