- Add Borland and Watcom test files (from object-testfiles)
- Add objdump snapshot outputs for all OMF test files
- Verify LIDATA expansion content and COMDAT sections/symbols in tests
The goal is to reduce the amount of casts required by API users, and
make it easier to correctly handle overflow later (not implemented by
this commit).
usize is still used in many places for counts.
Breaking changes:
- WritableBuffer trait method signatures
- various low level writer APIs
.dynsym needs to link to .dynstr. This matches the existing logic
for .symtab and .strtab. Also some minor dynstr_len cleanup.
Writer originally required this, but was changed in f3432e98. This
change was because there are files in the wild that are missing .dynstr,
and Builder needed to be able to handle them. Now that Builder is no
longer using Writer, I don't see any downside to writing the empty
.dynstr, so I think it's better to change Writer back again.
It's still possible to omit .dynstr if you use Builder (which uses
Encoder directly, not Writer), and there is a test for this.
* Fix R_ABS type
* Add macho::CpuType and CpuSubtype
Fixes a subtype check in MachOFile::sub_architecture().
readobj no longer displays subtypes for non-modern architectures.
* Add macho::VmProt
* Add macho::FileType and macho::FileFlags
Also fixes flag printing in readobj example.
* Add macho::LoadCommandType
* Add macho::DyldCacheMappingFlags
* Add macho::SegmentFlags, SectionFlags, and SectionType
* Add macho::DylibUseFlags
* Add macho build version newtypes
* Add macho::SymbolFlags
* Add macho::SymbolDesc
Also avoid returning an error in MachOFile::imports for
DYNAMIC_LOOKUP_ORDINAL and EXECUTABLE_ORDINAL.
* Add macho::DiceKind
* Add macho::ExportSymbolFlags
Includes slightly better validation of the flags value.
* Add macho::IndirectSymbol
The goal of these enums is to provide access to fields
that are not unambiguously provided by the unified API.
Some of these already provided type fields for some formats.
SectionKind is format independent, and the Elf variant never belonged
there. Fixing this now because adding a newtype for sh_type will also
be a breaking change.
These are very similar relocations, but we were handling them
differently. Change them both to the more accurate
RelocationKind::PltRelative and RelocationEncoding::X86Branch.
This also serves to list the cases where generic relocation flags are
useful for writing. We still handle generic relocation flags for some
other relocation types during writing, but I don't consider those to be
useful cases and don't test them here.