mirror of
https://github.com/RPCS3/llvm.git
synced 2024-12-14 15:39:06 +00:00
Add support for archives with no symbol table or string table.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185664 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
2c8ce86e7a
commit
6d88f9b73a
@ -104,7 +104,7 @@ Archive::Archive(MemoryBuffer *source, error_code &ec)
|
|||||||
: Binary(Binary::ID_Archive, source) {
|
: Binary(Binary::ID_Archive, source) {
|
||||||
// Check for sufficient magic.
|
// Check for sufficient magic.
|
||||||
if (!source || source->getBufferSize()
|
if (!source || source->getBufferSize()
|
||||||
< (8 + sizeof(ArchiveMemberHeader) + 2) // Smallest archive.
|
< (8 + sizeof(ArchiveMemberHeader)) // Smallest archive.
|
||||||
|| StringRef(source->getBufferStart(), 8) != Magic) {
|
|| StringRef(source->getBufferStart(), 8) != Magic) {
|
||||||
ec = object_error::invalid_file_type;
|
ec = object_error::invalid_file_type;
|
||||||
return;
|
return;
|
||||||
|
2
test/Object/Inputs/archive-test.a-gnu-minimal
Normal file
2
test/Object/Inputs/archive-test.a-gnu-minimal
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
!<arch>
|
||||||
|
test/ 1372964340 1000 1000 100664 0 `
|
@ -9,6 +9,9 @@ RUN: llvm-nm %t2 | FileCheck %s -check-prefix BITCODE
|
|||||||
Test we don't error with an archive with no symtab.
|
Test we don't error with an archive with no symtab.
|
||||||
RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab
|
RUN: llvm-nm %p/Inputs/archive-test.a-gnu-no-symtab
|
||||||
|
|
||||||
|
Or in an archive with no symtab or string table.
|
||||||
|
RUN: llvm-nm %p/Inputs/archive-test.a-gnu-minimal
|
||||||
|
|
||||||
COFF: trivial-object-test.coff-i386:
|
COFF: trivial-object-test.coff-i386:
|
||||||
COFF-NEXT: 00000000 d .data
|
COFF-NEXT: 00000000 d .data
|
||||||
COFF-NEXT: 00000000 t .text
|
COFF-NEXT: 00000000 t .text
|
||||||
|
Loading…
Reference in New Issue
Block a user