This is an archive of the discontinued LLVM Phabricator instance.

[Object][Archive] Support a new archive member /<ECSYMBOLS>/
ClosedPublic

Authored by pzheng on Jun 6 2022, 11:00 AM.

Details

Summary

Some libraries (e.g., arm64rt.lib) from the Windows WDK (version 10.0.22000.0)
contain an undocumented special member '/<ECSYMBOLS>/'. This causes llvm-lib to
fail with the following error:

"truncated or malformed archive (long name offset characters after the '/' are
not all decimal numbers: '<ECSYMBOLS>/' for archive member header at offset 162)"

The '/<ECSYMBOLS>/' member does not seem to be documented anywhere, but might be
related to the ARM64EC ABI Microsoft announced last year.

https://blogs.windows.com/windowsdeveloper/2021/06/28/announcing-arm64ec-building-native-and-interoperable-apps-for-windows-11-on-arm/

Diff Detail

Event Timeline

pzheng created this revision.Jun 6 2022, 11:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 11:00 AM
pzheng requested review of this revision.Jun 6 2022, 11:00 AM
Herald added a project: Restricted Project. · View Herald TranscriptJun 6 2022, 11:00 AM
thakis accepted this revision.Jun 6 2022, 12:02 PM

Thanks!

This revision is now accepted and ready to land.Jun 6 2022, 12:02 PM
thieta accepted this revision.Jun 6 2022, 12:36 PM

I think you can drop the content lines from the test cases. But other that that it looks fine.

I think you can drop the content lines from the test cases. But other that that it looks fine.

I tried removing the content lines from the test case, but got the following error somehow. Any idea?

"truncated or malformed archive (offset to next archive member past the end of the archive after member foo-arm64ec.obj)"

CC:ing @efriedma here, who's working on the arm64ec support.

I suspect we'll need to do something with the ECSYMBOLS section at some point, but given the lack of documentation, this is probably good enough for now.

I think you can drop the content lines from the test cases. But other that that it looks fine.

I tried removing the content lines from the test case, but got the following error somehow. Any idea?

"truncated or malformed archive (offset to next archive member past the end of the archive after member foo-arm64ec.obj)"

Did you update the Size fields too? I suspect those might be the problem. I also think you should inline the test input into the test file, since it's presumably only going to be used in the one test - having the test input close to the test commands themselves makes it easier to see what the test is doing. Finally, if you don't need all the library members for the test (it doesn't look to me like you do), you should remove them, leavnig only the ECSYMBOLS one.

I think you can drop the content lines from the test cases. But other that that it looks fine.

I tried removing the content lines from the test case, but got the following error somehow. Any idea?

"truncated or malformed archive (offset to next archive member past the end of the archive after member foo-arm64ec.obj)"

Did you update the Size fields too? I suspect those might be the problem. I also think you should inline the test input into the test file, since it's presumably only going to be used in the one test - having the test input close to the test commands themselves makes it easier to see what the test is doing. Finally, if you don't need all the library members for the test (it doesn't look to me like you do), you should remove them, leavnig only the ECSYMBOLS one.

Thanks for the tips, @jhenderson. The error is gone after updating the size field. I just pushed the changes to the test here: https://reviews.llvm.org/D127235.