Commit Graph

363 Commits

Author SHA1 Message Date
Folkert
748b2cf23a
make condition stricter 2022-10-30 00:51:42 +02:00
Folkert
21a2f6f103
remove relocation entry logic 2022-10-30 00:46:58 +02:00
Folkert
5a67687bba
deal with a stack probe symbol on windows 2022-10-29 23:19:45 +02:00
Folkert
a9d36431ba
don't put in relocations ?! 2022-10-29 17:01:51 +02:00
Folkert de Vries
9f62e65892
Merge pull request #4406 from roc-lang/windows-effect-loop
Windows effects.roc
2022-10-29 00:29:35 +02:00
Folkert
548ef1358d
remove debug print 2022-10-26 19:09:16 +02:00
Folkert
7c91aa79c9
when encountering memcpy, actually look for roc_memcpy 2022-10-26 16:37:59 +02:00
Folkert
5311d9a02b
Revert "redirect libc functions to their roc equivalents"
This reverts commit 4a75b5ad5827999592ebc0f66debe90f09e87bf5.
2022-10-26 16:36:10 +02:00
Folkert
73796f2b05
rename 2022-10-26 16:34:04 +02:00
Folkert
e6c75ea3b6
make relocation calculation more robust 2022-10-26 16:33:10 +02:00
Folkert
2ad7dc0ca0
redirect libc functions to their roc equivalents 2022-10-26 16:32:37 +02:00
Brendan Hansknecht
7189d79572
remove clap from linker deps 2022-10-25 15:41:00 -07:00
Brendan Hansknecht
e25475e7a1
dummy -> stub. Also minor help message update. 2022-10-24 18:52:11 -07:00
Brendan Hansknecht
dead264798
add macho dummy lib generation with ld 2022-10-24 18:47:12 -07:00
Brendan Hansknecht
d6bdd2aec7
create a roc sub command for generating a dummy lib 2022-10-24 18:47:11 -07:00
Folkert
b4878e5550
Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects 2022-10-24 18:39:30 +02:00
Folkert
1d45b7d1b5
remove a copy 2022-10-23 22:59:25 +02:00
Folkert
43c3095337
fix bug in loop 2022-10-23 22:55:01 +02:00
Folkert
0071c9aa04
update the dynhost file (dll name is now different) 2022-10-23 21:30:52 +02:00
Folkert
c4e407f703
remove subtraction of image base; value is already an rva 2022-10-23 20:19:34 +02:00
Folkert
28665abc96
use libapp.dll as the dll name 2022-10-23 20:18:09 +02:00
Folkert
ca90b00588
correctly update the size of the base relocations (round up to multiple of 8) 2022-10-23 20:16:46 +02:00
Folkert
f0f94107d5
deal with imports being stored in .idata or .rdata 2022-10-23 20:15:35 +02:00
Folkert
9c9e495e14
deal with our dummy dll not being the last import in the file 2022-10-23 20:10:38 +02:00
Folkert
215cacb260
add .lib file generation for windows 2022-10-23 20:06:31 +02:00
Folkert
0d3c039341
refactor dll symbol name generation 2022-10-23 20:06:30 +02:00
Folkert
e3df138c45
fix typo 2022-10-23 20:05:24 +02:00
Folkert
c55a3e7b37
resize reloc section when required 2022-10-22 14:49:59 +02:00
Folkert
ebac056814
Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects 2022-10-21 23:05:34 +02:00
Folkert
d0492327e8
Revert "re-enable"
This reverts commit 644a12e7aa.
2022-10-19 17:41:46 +02:00
Folkert
644a12e7aa
re-enable 2022-10-19 16:52:51 +02:00
Folkert
4de148456c
stop updating reloc data directory 2022-10-19 15:32:34 +02:00
Folkert
e2128a55f4
add assert to check we fit in the reloc section 2022-10-19 15:12:51 +02:00
Folkert
a572622ff7
update basereloc dir size 2022-10-19 14:12:41 +02:00
Folkert
5e10dddd6f
support multiple app relocations per symbol 2022-10-18 18:43:40 +02:00
Folkert
27aaaf9c26
remove debug logs 2022-10-17 21:25:30 +02:00
Folkert
58c7a21569
make relocations work when the .rdata section is bigger than a 4kb page 2022-10-17 21:21:27 +02:00
Folkert
7143abdedb
remove unused import on windows 2022-10-16 14:28:01 +02:00
Folkert
323210c547
Merge remote-tracking branch 'origin/main' into roc-dev-inline-expects 2022-10-16 13:56:30 +02:00
Folkert
a063bfcd30
changes after review 2022-10-16 13:26:48 +02:00
Folkert
73e48c9b7c
add better comments 2022-10-16 01:03:03 +02:00
Folkert
b822c1c617
basics test now works! 2022-10-15 20:45:20 +02:00
Folkert
c15ab0461a
Merge remote-tracking branch 'origin/main' into windows-program-loading-scratchpad 2022-10-15 20:39:53 +02:00
Folkert
0e08ccdc0c
enable test that works 2022-10-15 20:34:24 +02:00
Folkert
ebc3e770de
more cleanup 2022-10-15 20:33:01 +02:00
Folkert
a5935b262b
cleanup 2022-10-15 20:31:36 +02:00
Folkert
e8dc02d578
remove unused import on windows 2022-10-15 20:30:59 +02:00
Folkert
b5fb200a91
ensure sections never have 0 virtual size 2022-10-15 20:29:50 +02:00
Folkert
b3cf1c6812
extract .dll relocation logic into function 2022-10-15 20:24:14 +02:00
Folkert
4c51893632
get rid of constants 2022-10-15 20:16:31 +02:00
Folkert
7ab46a144b
cleanup 2022-10-15 20:12:06 +02:00
Folkert
fdd921aeeb
add extra fields to metadata 2022-10-15 20:09:56 +02:00
Folkert
7529e10580
wip 2022-10-15 19:15:56 +02:00
Folkert
19ea3489cb
provide more libc functions for the expect implementation 2022-10-12 20:59:18 +02:00
Ayaz
3d17307bde
Merge pull request #4275 from roc-lang/surgical-error-msg
Give an error message when the surgical linker #3609
2022-10-10 10:08:33 -05:00
dependabot[bot]
1a9323ecdc
Bump libc from 0.2.133 to 0.2.135
Bumps [libc](https://github.com/rust-lang/libc) from 0.2.133 to 0.2.135.
- [Release notes](https://github.com/rust-lang/libc/releases)
- [Commits](https://github.com/rust-lang/libc/compare/0.2.133...0.2.135)

---
updated-dependencies:
- dependency-name: libc
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2022-10-10 13:00:20 +00:00
Brendan Hansknecht
3cf4459ea6
filter out debug and eh relocatoins 2022-10-09 15:48:23 -07:00
Brendan Hansknecht
b306c9a76b
give an error message when the surgical linker would fail with know issue #3609 2022-10-09 11:39:10 -07:00
Folkert
5dbd119391
WIP 2022-10-03 21:19:09 +02:00
Folkert
c3d49ab38b
improve write_dummy_sections style 2022-10-02 18:21:30 +02:00
Folkert
7a04c1e801
preprocess itself produces a functioning binary 2022-10-02 17:19:19 +02:00
Folkert
355bbcb3a7
improve comment 2022-10-02 15:48:36 +02:00
Folkert
57e67f9878
ignore a test that does not yet work on windows 2022-10-02 15:43:39 +02:00
Folkert
675092db17
add a test for preprocessing 2022-10-02 15:41:15 +02:00
Folkert
78a5902261
on windows, run the .exe with the full path 2022-10-02 15:40:34 +02:00
Folkert
06e24fb44f
bump image size 2022-10-02 15:39:24 +02:00
Folkert
a798552dee
write valid dummy sections 2022-10-02 15:37:53 +02:00
Folkert
cf23feb996
track section alignment 2022-10-02 15:33:00 +02:00
Folkert
249901c73c
add libc functions to the linker crate, so we can run tests on windows 2022-10-02 15:29:24 +02:00
Folkert de Vries
2b91154b93
Merge pull request #4128 from roc-lang/static-relocations
PE inter-section relocations
2022-10-01 00:01:56 +02:00
Folkert
28eb6cc498
remove absolute again; this test does not actually test it 2022-09-29 21:37:35 +02:00
Folkert
1a7025b20c
clippy things 2022-09-29 00:27:28 +02:00
Folkert
1254c9f8db
clippy 2022-09-28 20:39:16 +02:00
Folkert
4780144e38
simplify PE tests 2022-09-28 20:36:00 +02:00
Folkert
ba704d731f
do inter-app relocations (PE) 2022-09-28 20:35:27 +02:00
Folkert
d70625b21b
improved symbol debugging output from the surgical linker 2022-09-28 14:11:54 +02:00
Brian Carroll
173a4ec8ab
Define roc_memmove in case LLVM decides to use memmove 2022-09-27 21:24:23 +01:00
Folkert
b725b36697
add support for absolute relocations 2022-09-25 19:09:56 +02:00
Folkert
fdbb0c8e3c
rename LittleEndian -> LE 2022-09-25 13:54:52 +02:00
Folkert
65fd6e9e86
add a zig-based elf linker test 2022-09-25 13:46:03 +02:00
Folkert
9ba0103715
only pass endianness down 2022-09-25 13:09:58 +02:00
Folkert
fbe3f359e2
fix a test 2022-09-25 01:51:16 +02:00
Folkert
49eff224bc
split elf and macho linking into their own files 2022-09-25 01:14:03 +02:00
Folkert
89938cc80e
pass the roc app bytes into the linker
as opposed to opening a file 'within' the linker
2022-09-24 23:03:43 +02:00
Folkert
320aa504cd
fix underflow in duration calculation 2022-09-24 22:53:54 +02:00
Folkert
1d875a32fb
bubble up Path 2022-09-24 17:41:11 +02:00
Folkert
55aee0c6ab
extract metadata collection 2022-09-24 17:17:00 +02:00
Folkert
764637594e
centralize mmap logic 2022-09-24 16:55:53 +02:00
Folkert
baa0dcc359
more paths 2022-09-24 16:26:36 +02:00
Folkert
3f87c1b60c
cleanup 2022-09-24 16:09:55 +02:00
Folkert
c220f0c296
open host with an mmap 2022-09-24 15:46:08 +02:00
Folkert
cbc04acc2c
remove a magic constant 2022-09-24 15:14:04 +02:00
Folkert
f1e05f6d13
centralize metadata file IO 2022-09-24 14:49:23 +02:00
Folkert
51f8bf496f
remove magic constant 2022-09-24 14:40:36 +02:00
Folkert
f88dc0308b
restructure the preprocessing entry point 2022-09-24 14:40:24 +02:00
Folkert
71a26d32d2
remove unused argument 2022-09-24 14:16:58 +02:00
Folkert
1251769eb5
add comment to metadata 2022-09-24 13:55:51 +02:00
Folkert
0b4682a73f
remove a magic offset 2022-09-24 13:48:58 +02:00
Folkert
228e5d831d
remove dead_code pragmas 2022-09-24 13:32:07 +02:00
Folkert
baed73d9f2
renaming 2022-09-23 20:57:57 +02:00
Folkert
f7a2eff34b
refactor 2022-09-23 20:48:41 +02:00
Folkert
3131bd1a2f
Merge remote-tracking branch 'origin/pe-host-to-app' into windows-surgical-linker-first-roc-file 2022-09-23 20:17:42 +02:00
Folkert
f632e299cd
cross-compile C for windows with zig 2022-09-23 19:46:27 +02:00
Folkert
aae2dbf17c
remove test we don't need any more 2022-09-23 18:29:27 +02:00
Folkert
d871e2a14f
add the -rdynamic flag 2022-09-23 14:52:52 +02:00
Folkert
8811123811
add .exe extension when target is windows 2022-09-23 14:52:52 +02:00
Folkert
8634f284b5
call host functions from the app 2022-09-23 14:52:51 +02:00
Folkert
78e1328064
remove magic constant 2022-09-23 14:52:51 +02:00
Folkert
eca17a493f
Revert "some work on a .dll import section; immediately revert"
This reverts commit f151044afc.
2022-09-23 14:52:51 +02:00
Folkert
e5a2726daf
some work on a .dll import section; immediately revert 2022-09-23 14:52:50 +02:00
Folkert
438bc0e602
use the -rdynamic flag to have zig produce an export section for the host 2022-09-23 14:52:50 +02:00
Folkert
fd5e0c9dda
missed some renames 2022-09-23 11:26:17 +02:00
Folkert
fae1d96474
more renames 2022-09-23 11:26:16 +02:00
Folkert
84b5a3479b
refactor (this is useful later for actual surgical linking 2022-09-23 11:26:16 +02:00
Folkert
b9b5dd32b2
rename some things 2022-09-23 11:26:16 +02:00
Folkert
3c5355aa2d
add comment 2022-09-23 11:26:16 +02:00
Folkert
87cdc6a9c7
refactor section header writing 2022-09-23 11:26:15 +02:00
Folkert
45d47e9ad5
add windows test 2022-09-23 11:26:15 +02:00
Folkert
0eafaaf977
cleanup 2022-09-23 11:26:15 +02:00
Folkert
63303844dd
support multiple symbols (from the same section) 2022-09-23 11:26:14 +02:00
Folkert
2a5d22739d
support multiple text and rdata sections 2022-09-23 11:26:14 +02:00
Folkert
cc0ee8c2fd
use an exported constant in the host 2022-09-23 11:26:14 +02:00
Folkert
8a6a126c19
copy in the app's .rdata section 2022-09-23 11:26:13 +02:00
Folkert
e2f799b6e0
fold experimental stuff into old test 2022-09-23 11:26:13 +02:00
Folkert
0f7c8c37bf
more cleanup 2022-09-23 11:26:13 +02:00
Folkert
9777ae64a5
slowly cleaning up 2022-09-23 11:26:12 +02:00
Folkert
3229a10764
actually append the app bytes into the new section 2022-09-23 11:26:12 +02:00
Folkert
d5cd4776c0
using the mmap 2022-09-23 11:26:12 +02:00
Folkert
004a9895fa
empty second text section 2022-09-23 11:26:11 +02:00
Folkert
59b4699668
extra .text section created 2022-09-23 11:26:11 +02:00
Folkert
dbc5f9e3e7
get rid of a copy of the data 2022-09-23 00:25:20 +02:00
Folkert
c9c08a28ec
cleanup 2022-09-23 00:16:31 +02:00
Folkert
79337f1333
move more into the dynhost 2022-09-23 00:15:54 +02:00
Folkert
8f7497acb7
write import directory size in the dynhost, not the executable 2022-09-23 00:13:11 +02:00
Folkert
32dab538ea
refactor 2022-09-23 00:07:28 +02:00
Folkert
2631970851
use mmap 2022-09-23 00:06:57 +02:00
Folkert
56bf57dab1
improve calculation of section index 2022-09-23 00:04:57 +02:00
Folkert
1c8b717af4
Revert "move the erasing of the .dll information to the precompiled host"
This reverts commit ba8baae0dc.
2022-09-22 23:51:52 +02:00
Folkert
ba8baae0dc
move the erasing of the .dll information to the precompiled host 2022-09-22 23:45:17 +02:00
Folkert
5b9e152248
use cached dynamic_relocations 2022-09-22 21:58:54 +02:00
Folkert
1ebcf25fc0
cleanup 2022-09-22 21:56:40 +02:00
Folkert
9bbe0e029f
refactor 2022-09-22 21:55:31 +02:00
Folkert
540d3c29f9
enable the windows surgical linker, for now 2022-09-22 21:53:48 +02:00
Folkert
1c95fd3761
a functional windows surgical linker 2022-09-22 21:28:27 +02:00
Folkert
466b5d78cb
linking of a very simple roc program 2022-09-22 00:32:36 +02:00
Folkert
e88b61734c
add .exe extension when target is windows 2022-09-21 18:11:59 +02:00
Folkert
05feeeb253
call host functions from the app 2022-09-21 17:42:08 +02:00
Folkert
7399dc8ae4
remove magic constant 2022-09-21 15:27:33 +02:00
Folkert
0cc75ae27c
Revert "some work on a .dll import section; immediately revert"
This reverts commit f151044afc.
2022-09-21 15:26:52 +02:00
Folkert
f151044afc
some work on a .dll import section; immediately revert 2022-09-21 15:26:44 +02:00