1025 Commits

Author SHA1 Message Date
Luke Street 806469a22f Support big-endian PowerPC COFF
Also adds PPC COFF magic to File::parse
2025-06-29 17:57:22 -06:00
Martin Liška e32d8830c5 Add EF_RISCV_RV64ILP32 constant (#779) 2025-06-19 12:13:33 +10:00
Philip Craig 4b833202b2 Release 0.37.1 2025-06-11 21:45:45 +10:00
Philip Craig 80510455f9 Update Cargo.lock 2025-06-11 21:45:45 +10:00
Philip Craig c222a099f4 Update wasmparser dependency 2025-06-11 21:45:45 +10:00
Trevor Gross 76c63ac2da Remove compiler-builtins from rustc-dep-of-std dependencies (#777)
Since [1], this will come automatically from `rustc-std-workspace-core`
and the crates.io dependency should no longer be specified.

[1]: https://github.com/rust-lang/rust/pull/141993
2025-06-11 13:56:00 +10:00
Philip Craig 3d7f84d619 Release 0.37.0 2025-06-02 17:41:23 +10:00
Philip Craig bbb0d5b55e Update Cargo.lock 2025-06-02 17:41:23 +10:00
Philip Craig 7e0a25ef87 Update wasmparser and ruzstd dependencies 2025-06-02 17:41:23 +10:00
Philip Craig 8130a962a0 read/macho: implement dyld slide version 2 and 3 2025-06-02 12:46:26 +10:00
Philip Craig b82e43318f read/macho: move v5 slide iteration to a single struct
Having a separate versioned DyldCacheRelocationPageIterator
is a flexibility that is not required, and combining them
is simpler.
2025-06-02 12:46:26 +10:00
Philip Craig 5c9425a15d read/macho: add None variant to DyldCacheSlideInfoSlice
This takes the place of wrapping it in Option.
Also shorten its name.
2025-06-02 12:46:26 +10:00
Philip Craig b5218d8291 read/macho: hide internals of DyldCacheRelocationMappingIterator
This will be useful when supporting more slide versions.
Also shorten its name.
2025-06-02 12:46:26 +10:00
Philip Craig 46f309b7c0 read/macho: change abstraction level on DyldCacheSlidePointer5
Change the methods on DyldCacheSlidePointer5 to simply extract
the bitfields, and leave other interpretation to the parser.

Also move PtrauthKey to DyldRelocationAuth, since it is not
an externally defined format.
2025-06-02 12:46:26 +10:00
Philip Craig 294bc13d84 read/macho: change DyldRelocation to only include the offset
I think the offset can be useful in itself, and the address
and file offset are easily derived from it.
2025-06-02 12:46:26 +10:00
Philip Craig 1fbd4a1f6c readobj/macho: print more dyld cache headers
Print the cache header and mappings for every subcache, instead
of only the primary cache file.

Also print the mapping slide information headers.
2025-06-02 12:46:26 +10:00
Philip Craig df75a62fd7 read/macho: change DyldCacheMapping internals to private
Also extract common fields of the mapping enum.
2025-06-02 12:46:26 +10:00
Philip Craig e8fb5ee18a read/macho: simplify DyldCacheMappingSlice
Delete fields that are duplicates of information in DyldCache and
DyldFile. This makes the enum similar to DyldSubCacheSlice.
2025-06-02 12:46:26 +10:00
Philip Craig e703ca18e8 read/macho: delete unused DyldCacheImageInfo::file_offset
This is leftover from before subcaches were supported.
2025-06-02 12:46:26 +10:00
Philip Craig fd0e96500a readobj/macho: fix symbol table in dyld cache
The symbol table data is stored in the linkedit segment,
but that segment may be in a different subcache from the
one containing the image headers. This occurs for the
arm dyld cache in macOS 13.

MachOFile::parse_dyld_cache_image already handled this
correctly, but readobj doesn't use that.
2025-06-02 12:46:26 +10:00
Philip Craig a149a2b811 read/macho: fix check for presence of mapping slide info
Note: I think this slide info is present since macOS 11.
I have tested on a dyld cache from macOS 11, but I don't have
an older dyld cache to test on.
2025-06-02 12:46:26 +10:00
hev 013fac75da elf: Update LoongArch relocation types per LoongArch ABI v2.30 (#773) 2025-05-25 13:58:51 +10:00
Philip Craig d1091fbb68 read/coff: fix has_aux_function for weak externals (#772)
has_aux_function previously matched weak externals too, resulting in
a wrong interpretation of their auxiliary symbol in the readobj
example.

Removed use of `else` for checking auxiliary symbols in readobj
so that it is more apparent when these are wrong.

Also add objdump and readobj test output for weak externals.
2025-05-25 13:55:00 +10:00
Matt Ehrnschwender f96add9f82 read/coff: Add support for auxiliary weak external symbols (#770)
* read/coff: add has_aux_weak_external()

Exposes `has_aux_weak_external()` method in the `pe::ImageSymbol` trait
for checking if a symbol has a weak external auxiliary symbol record.

MS COFF specifies that a weak external has "EXTERNAL storage class,
UNDEF section number, and a value of zero" but clang and mingw both use
WEAK_EXTERNAL storage class instead of EXTERNAL.

* read/coff: add aux_weak_external()

Includes `aux_weak_external()` method in the COFF SymbolTable to get
the weak external auxiliary symbol from a symbol table index

* Change 'pe::IMAGE_WEAK_EXTERN_*' constants type

Constants should be `u32`s instead of `u16`s to match the type of the
weak external auxiliary symbol characteristics
2025-05-21 19:07:51 +10:00
Philip Craig 61474b7de8 read/wasm: support symbol table in linking section 2025-04-25 16:29:20 +10:00