It was discovered that certain extab actions contain
uninitalized data from the compiler. This provides
a way to zero out uninitialized data in DOL or object
files. Usage: `dtk extab clean input.dol output.dol`
A `clean_extab` setting was added to config.yml, so
projects can link the cleaned objects and target the
cleaned DOL hash.
* add shiftjis as possible data type for symbols
* usage of anyhow:bail! -> bail!
* revise output of sjis strings
* rename shiftjis internally, symbols now uses sjis instead of shiftjis
* remove sjis decoding error check as the output is a comment
* run cargo fmt
A few issues were causing linker errors:
- Auto-splits could contain symbols that have a
higher alignment than the split itself. Detect
this and create a new auto-split at these symbols.
- The analyzer can miss objects in between other
objects if there are no direct relocations to them.
In these cases, non-zero data could just get totally
lost. Detect and create symbols for these.
This allows WAD projects to use the auto-extraction
feature: decomp-toolkit will extract all `object`s
from a disc file or WAD file that exists in the
configured `object_base`.
This command was an early experiment and only worked
correctly on one game. The project system has long
superseded it. ELFs are better supported by
generating a project config via `elf config` and
using the DOL as the object target.
Closes#1Closes#4Closes#21
When a link order is unresolvable, decomp-toolkit
now prints out all of the TUs in a cycle, easing
debugging.
Example:
```
Cyclic dependency encountered while resolving link order: Dolphin/os/__start.c -> Dolphin/os/__ppc_eabi_init.cpp -> Dolphin/pad/PadClamp.c -> Dolphin/pad/pad.c
```
Thanks @simonlindholm for the toposort impl.
Extract configuration is now emitted in the output config, so
tooling can load and perform their own tasks on extracted assets
without having to parse YAML.
`header_type`:
- `symbol` (default): Emit a full symbol declaration.
- `raw`: Emit raw array data (for wrapping in your own declaration)
- `none`: Don't emit a header at all. (For custom processing)
`custom_type`/`custom_data`: Passed through to the output config
as-is for custom tasks.
When `extract_objects` is enabled, objects will be extracted once
from a disc image into `object_base`, and then used directly from
`object_base` going forward.
This allows users to delete the disc image from their `orig` dir
once the initial build completes.
This allows handling path conversions in a more structured way,
as well as avoiding needless UTF-8 checks. All argument inputs
use `Utf8NativePathBuf`, while all config entries use
`Utf8UnixPathBuf`, ensuring that we deserialize/serialize using
forward slashes. We can omit `.display()` and lossy UTF-8
conversions since all paths are known valid UTF-8.