On Thu, 12 Dec 2024, Johannes Khoshnazar-Thoma wrote:

Hi Martin, Hi List,

Am 27.11.24 um 12:40 schrieb Johannes Khoshnazar-Thoma:
Hi Martin Storsjö,

Am 22.11.24 um 13:13 schrieb Martin Storsjö:
 >
> This patch was approved and merged now (after some discussion and some
tweaks to
 > the implementation), see
>
https://sourceware.org/git/?p=binutils-gdb.git;a=commitdiff;h=3c557e1ae9c320efcfd4a7a91b752413a7bfd280.
 >
 > // Martin
 >

Parsing the wdmsec.lib symbol table has been improved a lot, however
for some sections I get a:

I didn't do any changes wrt parsing any symbol tables or so.

/home/johannes/mingw-build-binutils/sysroot/bin/x86_64-w64-mingw32-objdump: ntoskrnl.exe: file format not recognized
[...]

while most sections work:

ntoskrnl.exe:     file format pe-x86-64
[...]
ntoskrnl.exe:     file format pei-x86-64
[...]

(Those aren't "sections", those are archive members, i.e. inividual files.)

You didn't really specify what command you tried to execute here, and for what purpose - so you're really having me guess the intent here.

I didn't have a copy of wdmsec.lib handy myself, but now I do. I tried "x86_64-w64-mingw32-objdump -h wdmsec.lib" and found such errors.

Extracting the static archive to look at it closer, where multiple archive members have the exact same file name, is a bit tricky, but I have a hacked llvm-ar that extracts them with unique names.

It seems like binutils does recognize some of the short import library files, but not others.

See https://martin.st/temp/ntoskrnl.exe-779 and https://martin.st/temp/ntoskrnl.exe-780 for two such extracted files.

$ llvm-readobj ntoskrnl.exe-779 ntoskrnl.exe-780

File: ntoskrnl.exe-779
Format: COFF-import-file-x86-64
Type: code
Name type: name
Export name: IoFastQueryNetworkAttributes
Symbol: __imp_IoFastQueryNetworkAttributes
Symbol: IoFastQueryNetworkAttributes

File: ntoskrnl.exe-780
Format: COFF-import-file-x86-64
Type: const
Name type: name
Export name: IoFileObjectType
Symbol: __imp_IoFileObjectType
Symbol: IoFileObjectType

Two generally quite similar import objects.

$ x86_64-w64-mingw32-objdump -h ntoskrnl.exe-779 ntoskrnl.exe-780

ntoskrnl.exe-779:     file format pei-x86-64

Sections:
Idx Name Size VMA LMA File off Algn
  0 .idata$4      00000008  0000000000000000  0000000000000000  00000000  2**2
                  CONTENTS, ALLOC, LOAD, RELOC
  1 .idata$5      00000008  0000000000000000  0000000000000000  00000000  2**2
                  CONTENTS, ALLOC, LOAD, RELOC
  2 .idata$6      00000020  0000000000000000  0000000000000000  00000000  2**2
                  CONTENTS, ALLOC, LOAD
  3 .text         00000008  0000000000000000  0000000000000000  00000000  2**2
                  CONTENTS, ALLOC, LOAD, RELOC, CODE
x86_64-w64-mingw32-objdump: ntoskrnl.exe-780: file format not recognized


So apparently binutils doesn't recognize all of them; perhaps the variant "Type: const" isn't recognized? I guess it'd be possible to improve this aspect in binutils too.

// Martin

_______________________________________________
Mingw-w64-public mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/mingw-w64-public

Reply via email to