Revision control

Copy as Markdown

Other Tools

# `object` Change Log
--------------------------------------------------------------------------------
## 0.36.4
Released 2024/08/30.
### Added
* Added `pe::IMAGE_FILE_MACHINE_ARM64X` and `pe::IMAGE_FILE_MACHINE_CHPE_X86`.
* Added `elf::SHF_GNU_RETAIN` and `elf::SHF_GNU_MBIND`.
### Changed
* Fixed the checksum for COFF BSS section symbols in `write::Object`.
* Changed `read::CompressedData::decompress` to validate the decompressed size.
* Updated `wasmparser` dependency.
--------------------------------------------------------------------------------
## 0.36.3
Released 2024/08/07.
### Added
* Added `Iterator` implementations for various types in the low level read API.
### Changed
* Changed `from_bytes` constructors for integer endian types to `const`.
* Changed `next` methods in the low level read API to fuse after returning an
error.
* Updated `wasmparser` dependency.
--------------------------------------------------------------------------------
## 0.36.2
Released 2024/07/24.
### Changed
* Improved writing of GNU symbol versioning in `build::elf::Builder`.
* Fixed alignment of `SHT_HASH`/`SHT_GNU_verdef`/`SHT_GNU_verneed` sections in
`write::elf::Writer`.
* Fixed writing of GNU hash for absolute symbols in `build::elf::Builder`.
* Fixed writing of empty ELF string table in `write::Object`.
--------------------------------------------------------------------------------
## 0.36.1
Released 2024/06/29.
### Added
* Added `SectionKind::DebugString`.
* Added `Architecture::Sparc` and `Architecture::Sparc32Plus`.
* Added more RISC-V ELF relocation constants.
### Changed
* Changed `read::ElfFile::imports` to return the library for versioned symbols.
* Changed `read::MachOFile` to support Go's debug section compression.
* Reversed the order of Mach-O relocations emitted by `write::Object`.
--------------------------------------------------------------------------------
## 0.36.0
Released 2024/05/26.
### Breaking changes
* Deleted `data` and `align` parameters for `write::Object::add_subsection`.
Use `add_symbol_data` or `add_symbol_bss` instead.
* Changed methods in the lower level read API to accept or return `SectionIndex`
or `SymbolIndex` instead of `usize`.
* Deleted `SymbolKind::Null`. Changed `read::Object::sections` and `read::Object::symbols`
to no longer return null entries. This affects ELF and XCOFF.
* Changed `read::ObjectMap::object` to return `ObjectMapFile`. This handles
splitting the object file name into path and member.
* Changed `read::coff::ImageSymbol::address` to only return an address for
symbols that have an address.
### Added
* Added `pod::slice_from_all_bytes` and `pod::slice_from_all_bytes_mut`.
* Added `write::Object::set_subsections_via_symbols`.
Changed `write::Object::add_symbol_data` and `write::Object::add_symbol_bss`
to correctly handle zero size symbols when subsections are enabled.
* Added methods in the unified read API to return the lower level API structures.
Some existing methods were deprecated so that naming of these methods is more consistent.
* Added methods in the lower level read API to return a `SectionIndex` or `SymbolIndex`.
* Implemented `Display` for `read::SymbolIndex` and `read::SectionIndex`.
* Added `is_common`, `is_absolute`, `is_local`, and `is_weak` to `read::elf::Sym`.
### Changed
* Changed `read::ArchiveFile` to skip the `<ECSYMBOLS>` member.
* Fixed handling of segment data in the dyld shared cache.
* Changed `read::RelocationMap` to handle Mach-O section relocations.
* Changed `read::elf::RelocationSections` to ignore relocations that apply to relocations.
* Removed a lifetime bound from an argument in `read::elf::SectionTable::section_name`,
`read::elf::SymbolTable::symbol_name`, and `read::elf::SymbolTable::symbol_section`.
--------------------------------------------------------------------------------
## 0.35.0
Released 2024/04/10.
### Breaking changes
* Moved the `'file` lifetime parameter from `read::Object` to its associated types.
### Added
* Added support more section kinds in `build::elf`.
* Added thin archive support to `read::ArchiveFile`.
* Added `read::ReadCacheOps` and changed `read::ReadCache` bound from `Read + Seek` to `ReadCacheOps`.
* Added `read::ObjectSection::relocation_map`
* Added `read::ArchiveFile::symbols`.
* Added `BinaryFormat::native_object`.
### Changed
* The minimum supported rust version for the `read` feature and its dependencies
has changed to 1.65.0.
* Fixed `sh_offset` handling for `SHT_NOBITS` sections in `build::elf`.
* Fixed handling of ELF files with dynamic symbols but no dynamic strings.
* Fixed potential panics in `read::WasmFile` due to invalid function indices.
* Fixed handling of Wasm components in `read::WasmFile`.
* Fixed `sh_entsize` for 32-bit hash sections in `write::elf`.
* Fixed `sh_size` for attribute sections in `build::elf`.
* Fixed `sh_info` for `SHT_DYNSYM` sections in `build::elf`.
* Fixed handling of dynamic relocations with invalid `sh_link` in `build::elf`.
* Fixed parsing of member names containing '/' in `read::ArchiveFile`.
* Fixed handling of load segment alignments in `build::elf::Builder::read`.
--------------------------------------------------------------------------------
## 0.34.0
Released 2024/03/11.
### Breaking changes
* Replaced `macho::DyldSubCacheInfo` with `macho::DyldSubCacheEntryV1`.
Changed the return type of `macho::DyldCacheHeader::subcaches`.
### Changed
* Added `macho::DyldSubCacheEntryV2` and changed `read::macho::DyldCache`
to handle both versions. This is needed for macOS 13 and above.
--------------------------------------------------------------------------------
## 0.33.0
Released 2024/03/05.
### Breaking changes
* Deleted file format variants in `RelocationKind`. Replaced their usage
with `read::Relocation::flags` and `write::Relocation::flags`.
* Replaced `kind`, `encoding` and `size` fields in `write::Relocation`
with `RelocationFlags::Generic` in the `flags` field.
* Replaced `macho::FatHeader::parse`, `macho::FatHeader::parse_arch32`,
and `macho::FatHeader::parse_arch64` with `read::macho::MachOFatFile`,
`read::macho::MachOFatFile32` and `read::macho::MachOFatFile64`.
### Added
* Added `macho::PLATFORM_XROS` and `macho::PLATFORM_XROSSIMULATOR`.
* Added `build::elf::Builder` and associated types.
Extended `write::elf::Writer` to support this.
### Changed
* Changed the lifetime to `'data` for the return value of `ObjectSection::name`,
`ObjectSection::name_bytes`, `ObjectComdat::name`, `ObjectComdat::name_bytes`.
* Checked that sizes are smaller than the file length in `read::ReadCache`.
* Used `Vec::try_reserve_exact` for large allocations.
--------------------------------------------------------------------------------
## 0.32.2
Released 2023/12/24.
### Added
* Added ELF relocations for LoongArch ABI v2.20.
* Added ELF support for SHARC.
* Added `write::coff::Writer`.
* Added `SubArchitecture::Arm64EC` support for PE/COFF.
* Added `SubArchitecture::Arm64E` support for Mach-O.
* Added `read::Object::symbol_by_name` and `read::Object::symbol_by_name_bytes`.
* Added more functions to the low level API in `read::xcoff`.
* Added more functions to the low level API in `read::macho`.
### Changed
* Fixes for AArch64 relocation addends for Mach-O.
* Changes to `write::Object` output for Mach-O, including the addition of a `LC_DYSYMTAB` load command.
* Changed `write::Object` to always use `R_X86_64_PLT32` for x86-64 branches for ELF.
* Fixed `read::ObjectSymbol::kind` for undefined section symbols for COFF.
* Fixed `write::Object` to accept undefined section symbols for COFF.
* Improved parsing of auxiliary section symbols for COFF.
* Improved the selection of symbols for `read::Object::symbol_map`.
This includes changes to `read::Symbol::is_definition`.
* Changed `read::ObjectSymbol::kind` for ELF `STT_NOTYPE` symbols to `SymbolKind::Unknown`.
* Changed `read::ObjectSymbol::scope` for XCOFF `C_HIDEXT` symbols to `SymbolScope::Compilation`.
--------------------------------------------------------------------------------
## 0.32.1
Released 2023/09/03.
### Added
* Added `write::Object::set_macho_cpu_subtype`.
--------------------------------------------------------------------------------
## 0.32.0
Released 2023/08/12.
### Breaking changes
* Changed `read::elf::Note::name` to exclude all trailing null bytes.
* Updated dependencies, and changed some optional dependencies to use the `dep:`
feature syntax.
### Changed
* The minimum supported rust version for the `read` feature and its dependencies
has changed to 1.60.0.
* The minimum supported rust version for other features has changed to 1.65.0.
* Changed many definitions from `static` to `const`.
* Fixed Mach-O section alignment padding in `write::Object`.
* Changed `read::File` to an enum.
### Added
* Added `elf::ELF_NOTE_GO`, `elf::NT_GO_BUILD_ID`, and `read::elf::Note::name_bytes`.
* Added `read::FileKind::CoffImport` and `read::coff::ImportFile`.
* Added `Architecture::Csky` and basic ELF support for C-SKY.
* Added `read::elf::ElfSymbol::raw_symbol`.
--------------------------------------------------------------------------------
## 0.30.4
Released 2023/06/05.
### Changed
* Fixed Mach-O section alignment padding in `write::Object`.
--------------------------------------------------------------------------------
## 0.31.1
Released 2023/05/09.
### Changed
* Fixed address for global symbols in `read::wasm`.
* Fixed writing of alignment for empty ELF sections.
### Added
* Added more `elf::GNU_PROPERTY_*` definitions.
Added `read::elf::note::gnu_properties`, `write::StandardSection::GnuProperty`,
and `write::Object::add_elf_gnu_property_u32`.
* Added Mach-O support for `Architecture::Aarch64_Ilp32`.
* Added `Architecture::Wasm64`.
--------------------------------------------------------------------------------
## 0.31.0
Released 2023/04/14.
### Breaking changes
* Added a type parameter on existing COFF types to support reading COFF `/bigobj` files.
* Changed PE symbols to support COFF `/bigobj`.
Changed `pe::IMAGE_SYM_*` to `i32`.
Changed `pe::ImageSymbolEx::section_number` to `I32Bytes`.
Deleted a number of methods from `pe::ImageSymbol`.
Use the `read::pe::ImageSymbol` trait instead.
* Changed `pe::Guid` to a single array, and added methods to read the individual fields.
* Added `Symbol` type parameter to `SymbolFlags` to support `SymbolFlags::Xcoff`.
### Changed
* Fix alignment when reserving zero length sections in `write::elf::Write::reserve`.
* Validate command size in `read::macho::LoadCommandIterator`.
* Handle invalid alignment in `read::macho::MachoSection::align`.
* Accept `SymbolKind::Unknown` in `write::Object::macho_write`.
* Updated `wasmparser` dependency.
### Added
* Added more `elf::EF_RISCV_*` definitions.
* Added `read::elf::SectionHeader::gnu_attributes` and associated types.
Added `.gnu.attributes` support to `write::elf::Writer`.
* Added `write::Object::set_macho_build_version`.
* Added `read::FileKind::Xcoff32`, `read::FileKind::Xcoff64`, `read::XcoffFile`,
and associated types.
Added XCOFF support to `write::Object`.
* Added `read::FileKind::CoffBig`, `read::pe::CoffHeader` and `read::pe::ImageSymbol`.
* Added `elf::PT_GNU_PROPERTY`.
* Added `elf::ELFCOMPRESS_ZSTD`, `read::CompressionFormat::Zstandard`,
and Zstandard decompression in `read::CompressedData::decompress` using
the `ruzstd` crate.
* Added `read::elf::NoteIterator::new`.
--------------------------------------------------------------------------------
## 0.30.3
Released 2023/01/23.
### Added
* Added `SectionKind::ReadOnlyDataWithRel` for writing.
--------------------------------------------------------------------------------
## 0.30.2
Released 2023/01/11.
### Added
* Added more ELF constants for AVR flags and relocations.
--------------------------------------------------------------------------------
## 0.30.1
Released 2023/01/04.
### Changed
* Changed `read::ElfSymbol::kind` to handle `STT_NOTYPE` and `STT_GNU_IFUNC`.
### Added
* Added `read::CoffSymbol::raw_symbol`.
* Added ELF support for Solana Binary Format.
* Added ELF support for AArch64 ILP32.
--------------------------------------------------------------------------------
## 0.30.0
Released 2022/11/22.
### Breaking changes
* The minimum supported rust version for the `read` feature has changed to 1.52.0.
* The minimum supported rust version for the `write` feature has changed to 1.61.0.
* Fixed endian handling in `read::elf::SymbolTable::shndx`.
* Fixed endian handling in `read::pe::ResourceName`.
* Changed definitions for LoongArch ELF header flags.
### Changed
* Fixed parsing of multiple debug directory entries in `read::pe::PeFile::pdb_info`.
* Changed the section name used when writing COFF stub symbols.
### Added
* Added `read::pe::DataDirectories::delay_load_import_table`.
* Added `read::macho::LoadCommandData::raw_data`.
* Added ELF relocations for LoongArch ps ABI v2.
* Added PowerPC support for Mach-O.
* Added support for reading the AIX big archive format.
* Added support for `RelocationEncoding::AArch64Call` when writing Mach-O files.
* Added support for `RelocationKind::Relative` when writing RISC-V ELF files.
* Added Xtensa architecture support for ELF.
* Added `read::pe::ResourceName::raw_data`.
--------------------------------------------------------------------------------
## 0.29.0
Released 2022/06/22.
### Breaking changes
* The `write` feature now has a minimum supported rust version of 1.56.1.
* Added `os_abi` and `abi_version` fields to `FileFlags::Elf`.
### Changed
* Fixed handling of empty symbol tables in `read::elf::ElfFile::symbol_table` and
`read::elf::ElfFile::dynamic_symbol_table`.
### Added
* Added more `ELF_OSABI_*` constants.
--------------------------------------------------------------------------------
## 0.28.4
Released 2022/05/09.
### Added
* Added `read::pe::DataDirectories::resource_directory`.
* Added PE support for more ARM relocations.
* Added support for `Architecture::LoongArch64`.
* Added `elf::EF_MIPS_ABI` and associated constants.
--------------------------------------------------------------------------------
## 0.28.3
Released 2022/01/19.
### Changed
* For the Mach-O support in `write::Object`, accept `RelocationKind::MachO` for all
architectures, and accept `RelocationKind::Absolute` for ARM64.
### Added
* Added `pe::ImageDataDirectory::file_range`, `read::pe::SectionTable::pe_file_range_at`
and `pe::ImageSectionHeader::pe_file_range_at`.
* Added `write::Object::add_coff_exports`.
--------------------------------------------------------------------------------
## 0.28.2
Released 2022/01/09.
### Changed
* Ignored errors for the Wasm extended name section in `read::WasmFile::parse`.
* Ignored errors for the COFF symbol table in `read::PeFile::parse`.
* Fixed handling of `SectionFlags::Coff` in `write::Object::coff_write`.
### Added
* Added `read::ObjectSegment::flags`.
--------------------------------------------------------------------------------
## 0.28.1
Released 2021/12/12.
### Changed
* Fixed `read::elf::SymbolTable::shndx_section`.
* Fixed build warnings.
--------------------------------------------------------------------------------
## 0.28.0
Released 2021/12/12.
### Breaking changes
* `write_core` feature no longer enables `std` support. Use `write_std` instead.
* Multiple changes related to Mach-O split dyld cache support.
### Added
* Added `write::pe::Writer::write_file_align`.
* Added support for Mach-O split dyld cache.
* Added support for `IMAGE_SCN_LNK_NRELOC_OVFL` when reading and writing COFF.
* Added `write::elf::Writer::reserve_null_symbol_index`.
--------------------------------------------------------------------------------
## 0.27.1
Released 2021/10/22.
### Changed
* Fixed build error with older Rust versions due to cargo resolver version.
--------------------------------------------------------------------------------
## 0.27.0
Released 2021/10/17.
### Breaking changes
* Changed `read::elf` to use `SectionIndex` instead of `usize` in more places.
* Changed some `read::elf` section methods to additionally return the linked section index.
* Changed `read::pe::ImageNtHeaders::parse` to return `DataDirectories` instead of a slice.
* Deleted `value` parameter for `write:WritableBuffer::resize`.
* Changed `write::Object` and `write::Section` to use `Cow` for section data.
This added a lifetime parameter, which existing users can set to `'static`.
### Changed
* Fixed parsing when PE import directory has zero size.
* Fixed parsing when PE import directory has zero for original first thunk.
* Fixed parsing when PE export directory has zero number of names.
* Fixed parsing when PE export directory has zero number of names and addresses.
* Fixed parsing when PE sections are contiguous.
* Fixed `std` feature for `indexmap` dependency.
* Fixed overflow in COFF section name offset parsing.
### Added
* Added `name_bytes` methods to unified `read` traits.
* Added `read::Object::kind`.
* Added `read::elf::VersionTable` and related helpers.
* Added `read::elf::SectionTable::dynamic` and related helpers.
* Added `read::coff::SectionTable::max_section_file_offset`.
* Added `read::pe::ExportTable` and related helpers.
* Added `read::pe::ImportTable` and related helpers.
* Added `read::pe::DataDirectories` and related helpers.
* Added `read::pe::RichHeaderInfo` and related helpers.
* Added `read::pe::RelocationBlocks` and related helpers.
* Added `write::elf::Writer`.
* Added `write::pe::Writer`.
* Added `write::Section::data/data_mut`.
* Added `write::Object::write_stream`.
* Added MIPSr6 ELF header flag definitions.
--------------------------------------------------------------------------------
## 0.26.2
Released 2021/08/28.
### Added
* Added support for 64-bit symbol table names to `read::archive`.
--------------------------------------------------------------------------------
## 0.26.1
Released 2021/08/19.
### Changed
* Activate `memchr`'s `rustc-dep-of-std` feature
--------------------------------------------------------------------------------
## 0.26.0
Released 2021/07/26.
### Breaking changes
* Changed `ReadRef::read_bytes_at_until` to accept a range parameter.
* Added `ReadRef` type parameter to `read::StringTable` and types that
contain it. String table entries are now only read as required.
* Changed result type of `read::elf::SectionHeader::data` and `data_as_array`.
* Moved `pod::WritableBuffer` to `write::WritableBuffer`.
Renamed `WritableBuffer::extend` to `write_bytes`.
Added more provided methods to `WritableBuffer`.
* Moved `pod::Bytes` to `read::Bytes`.
* Added `is_mips64el` parameter to `elf::Rela64::r_info/set_r_info`.
### Changed
* Removed `alloc` dependency when no features are enabled.
### Added
* Added `read::pe::PeFile` methods: `section_table`, `data_directory`, and `data`.
* Added more ELF definitions.
* Added `read::elf::SectionTable` methods for hash tables and symbol version
information.
* Added PE RISC-V definitions.
* Added `WritableBuffer` implementation for `Vec`.
--------------------------------------------------------------------------------
## 0.25.3
Released 2021/06/12.
### Added
* Added `RelocationEncoding::AArch64Call`.
--------------------------------------------------------------------------------
## 0.25.2
Released 2021/06/04.
### Added
* Added `Architecture::X86_64_X32`.
--------------------------------------------------------------------------------
## 0.25.1
Released 2021/06/03.
### Changed
* write: Fix choice of `SHT_REL` or `SHT_RELA` for most architectures.
* write: Fix relocation encoding for MIPS64EL.
--------------------------------------------------------------------------------
## 0.25.0
Released 2021/06/02.
### Breaking changes
* Added `non_exhaustive` to most public enums.
* `MachHeader::parse` and `MachHeader::load_commands` now require a header offset.
* Added `ReadRef::read_bytes_at_until`.
* `PeFile::entry`, `PeSection::address` and `PeSegment::address` now return a
virtual address instead of a RVA.
### Added
* Added `pod::from_bytes_mut`, `pod::slice_from_bytes_mut`, `pod::bytes_of_mut`,
and `pod::bytes_of_slice_mut`.
* Added `Object::pdb_info`.
* Added `read::macho::DyldCache`, other associated definitions,
and support for these in the examples.
* Added more architecture support.
* Derive more traits for enums.
* Added `Object::relative_address_base`.
### Changed
* Improved performance for string parsing.
* `objdump` example allows selecting container members.