From 23faf88a88488c41fc4348ea2b70996803f84f40 Mon Sep 17 00:00:00 2001 From: Quentin Kaiser Date: Wed, 14 Feb 2024 09:51:16 +0100 Subject: [PATCH] Add support for 64-bit symbol lookup tables. To overcome the 4 GiB file size limit some operating system like Solaris 11.2 and GNU use a variant lookup table. Instead of 32-bit integers, 64-bit integers are used in the symbol lookup tables. The string "/SYM64/" instead "/" is used as identifier for this table[0]. A 32-bit archive symbol table has a zero length name, so ar_name contains the string "/" padded with 15 blank characters on the right. A 64-bit archive symbol table sets ar_name to the string "/SYM64/", padded with 9 blank characters to the right. [0]: https://docs.oracle.com/cd/E36784_01/html/E36873/ar.h-3head.html --- arpy.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arpy.py b/arpy.py index a2021ec..f88edd7 100644 --- a/arpy.py +++ b/arpy.py @@ -99,7 +99,7 @@ def __init__(self, header: bytes, offset: int) -> None: if name.startswith(b"#1/"): self.type = HEADER_BSD - elif name.startswith(b"//"): + elif name.startswith(b"//") or name.startswith(b"/SYM64/"): self.type = HEADER_GNU_TABLE elif name.strip() == b"/": self.type = HEADER_GNU_SYMBOLS