Anton-4
b552466755
glossary: type signature + typos upgrade ( #7776 )
...
* glossary: type signature
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
* ignore toolchain for typos
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
* fix typos
* put toolchain file back
---------
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-05-07 17:35:56 +02:00
Anton-4
cf18ab75dd
better linker tip ( #7721 )
...
better error msg
Signed-off-by: Anton-4 <17049058+Anton-4@users.noreply.github.com>
2025-03-31 19:57:30 +02:00
Jakub Konka
cd6749af44
linker/macho: error out if headerpad too small with better error message
2025-01-16 23:38:40 +01:00
Jakub Konka
fa85fc7e87
linker/macho: warn when headerpad is too small in host executable
...
Previously, I wrongly assumed that the Roc compiler controls how
the host is being built, but this is not the case. Therefore,
there is no way to automatically enforcing that the host will have
enough headerpad size. It may be possible to re-use the old idea
of shifting everything in file, however, this will necessitate also
shifting everything in memory since we absolutely have to shift
by page size to guarantee original alignment of sections. This then
becomes difficult as we will not only need update segments/sections
with new offsets and virtual addresses but also every rebase and binding
for the dynamic linker (which effectively means parsing the info and
recreating it). There may be even more avenues where updates are
required. Therefore, for the time being, let's nerf the error into
a warning since the linker is still experimental until we investigate
how difficult shifting actually is. If it turns out to be nigh
impossible, we will convert the warning back into a hard error and
the user will have to recompile the host with increased headerpad size.
Boy, this kinda reminds me of how errors are structured when one is
mixing PIC with non-PIC code ("recompile your code with -fPIC" or
similar).
2025-01-16 20:42:28 +01:00
Jakub Konka
5a164ccede
linker/macho: remove printlns used for debugging
2025-01-10 22:13:34 +01:00
Jakub Konka
66fd18fc0a
linker/macho: insert Roc-specific segment load commands
2025-01-10 21:59:50 +01:00
Jakub Konka
e4a97216a6
linker/macho: append expected Roc segment commands
2025-01-10 21:14:58 +01:00
Jakub Konka
afe6b51dc1
linker/macho: rename macho_cmd_loc to end_of_load_commands
2025-01-10 21:14:57 +01:00
Jakub Konka
d15e6f1d89
linker/macho: save offsets of linkedit load commands that we will need updating
2025-01-10 21:14:56 +01:00
Jakub Konka
5b2310d313
linker/macho: remove added_byte_count - we cannot shift anything beyond LINKEDIT anyhow
2025-01-10 21:14:55 +01:00
Jakub Konka
a8f80f3240
linker/macho: error out if not enough headerpad available
2025-01-10 21:14:54 +01:00
Jakub Konka
93a4e9924d
linker/macho: record start of first section following load commands
2025-01-10 21:14:40 +01:00
Sam Mohr
7a2f8bfa71
Merge branch 'main' into auto-snake-case
2025-01-07 13:18:41 -08:00
Jakub Konka
7200c992ff
linker/macho: ignore setjmp and longjmp since they are only used by roc test
2025-01-06 22:56:50 +01:00
Sam Mohr
665a0ee95e
revert changed binary files
2025-01-05 06:32:49 -08:00
Sam Mohr
865a399ba2
Merge branch 'main' into auto-snake-case
2025-01-05 05:28:30 -08:00
Sam Mohr
b56fbd38e1
Progress on updating entire compiler for snake_case
2025-01-05 03:48:03 -08:00
Jakub Konka
4980cd86c3
linker/macho: remove redundant checks for compressed sections
2025-01-04 20:24:18 +01:00
Jakub Konka
ae2159b536
linker/macho: remove now obsolete todo
...
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2025-01-03 00:13:30 +01:00
Jakub Konka
31e622d5a8
linker/macho: fix load_align_constraint to correct page size values
...
These are dependent on the CPU architecture and are 4KB for x86_64,
and 16KB for aarch64.
2025-01-02 23:31:15 +01:00
Jakub Konka
19dc28aa34
linker/elf: update relocation handling to new object API
2024-12-31 16:57:10 +01:00
Jakub Konka
e4fc3184a0
linker/macho: update relocation handling to new object API
2024-12-31 16:43:53 +01:00
Jakub Konka
8272f31b42
linker/macho: do not print any todos messages unless --verbose
2024-12-31 11:58:12 +01:00
Jakub Konka
dfbd0f0c66
linker/macho: include Mach-O specific reloc scanning for libc symbols
2024-12-31 11:58:08 +01:00
Jakub Konka
c4c9869a15
linker/macho: include read-only string sections when doing surgery
2024-12-31 11:58:03 +01:00
Jakub Konka
4764b23282
cli: add --verbose flag to CMD_BUILD
2024-12-31 11:57:59 +01:00
Jakub Konka
3b3f79a5d2
linker: pretty-print Mach-O specific reloc types
...
Signed-off-by: Jakub Konka <kubkon@jakubkonka.com>
2024-12-31 11:57:50 +01:00
Jakub Konka
94e9528c51
compiler: suppress Apple ld linker warnings
2024-12-30 16:29:05 +01:00
Jakub Konka
a4165b3642
linker: introduce SupportLevel to designate completeness
...
If a linker is `SupportLevel::Full` it can safely be used as a
substitute for the legacy linker. If on the other hand, it's
`SupportLevel::None` then only legacy linker is a viable option.
The third new option is `SupportLevel::Wip` which will enable
surgical linker warning the user that it is a work-in-progress,
your mileage may vary, a lot.
2024-12-30 16:27:50 +01:00
Jakub Konka
b0cd51f089
Revert "Revert "Merge pull request #7424 from kubkon/macho-surgery""
2024-12-30 16:26:42 +01:00
Anton-4
2dec72a797
Revert "Merge pull request #7424 from kubkon/macho-surgery"
...
This reverts commit 723e35f11e
, reversing
changes made to 0ce43ffd1e
.
2024-12-30 14:32:56 +01:00
Jakub Konka
d67371c351
Fix clippy warnings
2024-12-28 23:30:19 +01:00
Jakub Konka
707a6b6f0f
macho: recognise some libc imports
2024-12-28 10:04:38 +01:00
Jakub Konka
90fe145900
trim leading _ when searching for symbol in host and app
2024-12-28 10:04:38 +01:00
Jakub Konka
378659dfa9
refactor and log more output
2024-12-28 10:04:38 +01:00
Jakub Konka
88962f9e98
ignore __eh_frame section for the time being in macho surgery
2024-12-28 10:04:38 +01:00
Jakub Konka
32b9274dad
refactor collect_roc_definitions for MachO
...
I don't think we need to check for '@' in symbol naming as versioning
is not done on a symbol level for MachO as far as I remember (unlike for
Linux).
2024-12-28 10:04:38 +01:00
Jakub Konka
f847770f6e
abstract away logic for finding symbol by index
...
I am still not quite sure what exactly I am looking at in this function
but this will have to do for now.
Assuming this function, aka `get_target_offset`, is correct, implement
handling of `RelocationKind::Absolute` which for now assume is `UNSIGNED`
and pointer sized.
2024-12-28 10:04:38 +01:00
Jakub Konka
14ad642296
object::macho forces us to handle MachO relocs low-level
2024-12-28 10:04:38 +01:00
Jakub Konka
322366bab3
save generated app_data to an object file
2024-12-28 10:04:36 +01:00
Asustin Shotero
149b2d5099
add legacy linker recommendation
...
Signed-off-by: Asustin Shotero <56707055+Elkiders99@users.noreply.github.com>
2024-12-08 21:26:38 -03:00
Richard Feldman
bc0c9250f9
Convert unused dbg!()s to eprintln!()s
...
This makes it nicer to work with dbg! normally,
because grepping the code base for dbg!() reveals
only the usages of it that are currently active.
2024-12-01 23:10:35 -05:00
Luke Boswell
6c6f6e08a9
replace cargo deps with workspace in linker, packaging, repl_*
2024-11-29 10:53:54 +11:00
Luke Boswell
8a566dc339
WIP
2024-11-11 10:22:58 +11:00
Anton-4
9b7c6c9fe7
cleanup warnings
2024-10-23 19:36:03 +02:00
Anton-4
5953155f70
done with cli_tests
2024-10-19 19:25:50 +02:00
Anton-4
5b451f9288
fixed run_multi_dep_str
2024-10-16 18:24:14 +02:00
Luke Boswell
f515311915
clippy fix
2024-07-09 15:47:56 +10:00
Luke Boswell
287d00df85
remove gen_stub_lib
2024-07-09 15:24:24 +10:00
Luke Boswell
85447ec2cc
replace stray strings with impl on Target
2024-07-09 14:39:36 +10:00