| Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
* Update the msdos stub to be eight bytes smaller, which moves the
machine PE header field into the first 128 bytes of the file,
allowing it to be matched by a binfmt_misc magic sequence.
This allows the build system to get the correct error during exec.
* Fix library name memory leaks in Sema.
|
|
|
|
By default we garbage-collect sections for Wasm to reduce size, as well
as finish linking quicker (as we have fewer things to do). However,
when the user specifies `--no-gc-sections` we ensure all resolved symbols
get marked and therefore do not get garbage collected.
This is supported in both incremental-mode and traditional linking.
|
|
When using the Wasm backend, we will now also perform garbage collection
there, to ensure unreferenced symbols do not get parsed nor emit into
the final binary.
|
|
When we encounter a debug info symbol, we initially have to parse it
into an atom to find its relocations. We then go through its relocations
to find out if any of the target symbols are marked alive. When it
finds an alive symbol, we also mark the debug symbol as alive to ensure
this piece of debug info is emit to the binary. When it does not encounter
any alive symbols, the debug symbol remains dead and will be garbage-
collected during `allocateAtoms`.
|
|
|
|
When multiple symbols point to the same function, we ensure any
other symbol other than the original will be discarded and point
to the original instead. This prevents emitting the same function
code more than once.
|
|
Rather than parsing every symbol into an atom, we now only parse them
into an atom when such atom is marked. This means garbage-collected
symbols will also not be parsed into atoms, and neither are discarded
symbols which have been resolved by other symbols. (Such as multiple
weak symbols).
This also introduces a binary search for finding the start index into
the list of relocations. This speeds up finding the corresponding
relocations tremendously as they're ordered ascended by address.
Lastly, we re-use the memory of atom's data as well as relocations
instead of duplicating it. This means we half the memory usage of
atom's data and relocations for linked object files. As we are
aware of decls and synthetic atoms, we free the memory of those
atoms indepedently of the atoms of object files to prevent double-frees.
|
|
When a symbol is unreferenced and therefore garbage-collected, we do
not merge its specific section into the final binary.
|
|
Symbols which are exported to the host, or contain the `NO_STRIP`
flag, will be marked. All symbols which are referenced by this symbol
are marked likewise. We achieve this by parsing all relocations of a
symbol, and then marking the symbol it points to within the relocation.
|
|
When a linked object contains references to the __tls_base symbol,
we lazily create this symbol. However, we wouldn't create the corresponding
Wasm global. This meant its address wasn't set correctly as well as fail
to output it into the `Names` section.
|
|
|
|
|
|
In general, I don't like the idea of std.meta.trait, and so I am
providing some guidance by deleting the entire namespace from the
standard library and compiler codebase.
My main criticism is that it's overcomplicated machinery that bloats
compile times and is ultimately unnecessary given the existence of Zig's
strong type system and reference traces.
Users who want this can create a third party package that provides this
functionality.
closes #18051
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Closes #17811
|
|
closes #7265
|
|
|
|
Boundary symbols have a special name prefix:
* section$start$segname$sectname
* section$stop$segname$sectname
* segment$start$segname
* segment$stop$segname
and will resolve to either start or end of the respective
section/segment if found.
If not found, we return an error stating we couldn't find the
requested section/segment rather than silently failing and resolving
the address to 0 which seems to be the case with Apple's ld64.
|
|
elf: the dreaded `-r` mode
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|