Skip to content

Commit

Permalink
Ignore /SYM64/ pseudo member inar
Browse files Browse the repository at this point in the history
I believe this pseudo member is relatively new to support archive
files larger than 4 GiB. I'm not sure if mold can handle such large
archives, but first of all, mold crashes when an archive with this
pseudo member is given.

This commit fixes the crash bug.

I don't know how to create an archive with this pseudo member, so
this commit does not have a testcase.

Reported by sina-ht at #269.
  • Loading branch information
rui314 committed Jan 13, 2022
1 parent d8dc8a6 commit bba506d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion archive-file.h
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,8 @@ read_fat_archive_members(C &ctx, MappedFile<C> *mf) {
}

// Skip if symbol table
if (memcmp(hdr.ar_name, "/ ", 2) == 0)
if (memcmp(hdr.ar_name, "/ ", 2) == 0 ||
memcmp(hdr.ar_name, "/SYM64/ ", 8) == 0)
continue;

// Read the name field
Expand Down

0 comments on commit bba506d

Please sign in to comment.