Commit Graph

32 Commits

Author SHA1 Message Date
Jeremy Soller ee0193aa7e Add missing import 2022-11-11 17:06:50 -07:00
Jeremy Soller 16abc91341 cargo fmt and cargo fix 2022-11-11 13:27:18 -07:00
Jeremy Soller c59b94d102 Hacks to support aarch64 static TLS 2022-08-25 19:03:49 -06:00
Jeremy Soller 6591cf699d Set aarch64 tcb 2022-08-24 19:24:26 -06:00
Jeremy Soller c547f9677f Use GS for i686 thread pointer 2022-08-20 21:11:18 -06:00
Jeremy Soller 8b629a562b Syntax error 2022-08-20 20:52:19 -06:00
Jeremy Soller a1d0b8fc35 More x86 fixes 2022-08-20 20:51:01 -06:00
Jeremy Soller 0bd81aa3d4 Update llvm_asm to asm for aarch64 2022-07-26 11:46:50 -06:00
Jeremy Soller 559387cc64 Initial support for x86 32-bit 2022-07-22 16:24:45 -06:00
4lDO2 ebd597f748 Update dependencies for rust 2022-03-18. 2022-03-24 17:12:02 +01:00
4lDO2 a388b1ae4d Initialize TLS manually on Redox too. 2021-08-05 11:49:40 +02:00
Jeremy Soller 602fd9fe08 Fixes for TCB arch_read on aarch64 2021-04-28 21:29:09 -06:00
Peter Limkilde Svendsen 9e8cd0bf07 Centralize page size info in platform abstraction 2021-03-24 00:02:39 +01:00
Robin Randhawa 886f467a75 aarch64: TLS arch_read implementation 2021-01-18 22:01:32 +00:00
Jeremy Soller 3c1300e8ec Improvements for aarch64 support 2021-01-11 08:52:20 -07:00
Mateusz Tabaka 6497d71d2f Fix dlsym of TLS variables 2021-01-05 22:33:22 +01:00
Mateusz Tabaka a7480ea656 Fix global symbols relocations
Instead of a single source of symbols, now linker keeps a list of DSO (former Library) objects
with their own symbols map. That helps to process R_X86_64_COPY relocations correctly.
For example, if 'a.out' executable with dependencies ['libstdc++.so', 'libc.so'] is being loaded
and 'a.out' uses 'stdout' symbol from 'libc.so', its relocation process goes as follows:
- linker processes relocation entry 'stdout' of type R_X86_64_GLOB_DAT from 'libc.so',
- it goes through object list ['a.out', 'libstdc++.so', 'libc.so'] to find first object
  that exports 'stdout' symbol. The symbol is in 'a.out' with the value e.g. '0x404070',
- linker sets 'stdout' symbol GOT entry in 'libc.so' to '0x404070',
....
- linker processes relocation entry 'stdout' of type R_X86_64_COPY from 'a.out',
- it goes through object list excluding 'a.out': ['libstdc++.so', 'libc.so']. The symbol is found in 'libc.so',
- linker copies the 'stdout' symbol content from 'libc.so' to memory at address '0x404070' (in 'a.out' object).

Objects are relocated in reverse order they were loaded. So in the example above, linker starts with relocating
'libc.so' and ends with 'a.out'. It is necessary e.g. when linking with 'libstdc++.so' - there are many
relocations which symbols are found in 'libstdc++.so', so they need to be resolved before their contents are
copied to 'a.out'. That also matches GNU ld.so behavior.
2021-01-03 16:04:40 +01:00
Jeremy Soller f2c2d7c52e Fix compilation on newer nightly, update nightly to 2020-08-01 2020-08-02 12:24:49 -06:00
oddcoder 3a8817072c Initialize the mspaces of allocator and keep track of it 2020-07-18 21:03:20 +02:00
oddcoder c2488b5094 Running ./fmt.sh
These files needs formating by the auto formatter and It keeps popping
up every time I format my own code.
2020-03-07 23:52:27 +02:00
Jeremy Soller 2cbc78f238 Add linker pointer 2019-12-18 21:15:00 -07:00
Jeremy Soller 4818ad61ab Always zero mmap'd memory 2019-12-15 07:46:59 -07:00
jD91mZM2 b8c50c7c64 Format 2019-08-04 19:05:45 +02:00
jD91mZM2 c7d499d4f2 Upgrade to the 2018 edition
I didn't think it'd be this useful first, but thank god for `cargo fix --edition`!
2019-08-04 19:05:45 +02:00
Mateusz Mikuła 7597c082e7 Fix Clippy warnings 2019-05-11 22:34:13 +02:00
Jeremy Soller 7bde036031 Remove va_list submodule, format 2019-04-21 15:45:55 -06:00
Jeremy Soller b2cc25dd38 Fix missing import 2019-04-21 15:28:19 -06:00
jD91mZM2 6d4ac9dba8 Finally, get rid of all rust warnings
Just a small step along the way to reduce the massive wall of spam
every time you compile.

This was done partly automagically with `cargo fix`. The rest was me
deleting or commenting out a bunch of variables. Hope nothing was
important...
2019-04-21 21:12:16 +02:00
Jeremy Soller 83f89912e0 Do not copy kernel-allocated TLS 2019-04-20 10:36:18 -06:00
Jeremy Soller 30aef27c76 Correctly set up TLS on Redox and other fixes for pthread_clone 2019-04-14 19:08:58 -06:00
Jeremy Soller 5a005864a8 Fix compilation on redox 2019-04-14 13:18:57 -06:00
Jeremy Soller 361f32b63c ld_so: significant refactor to prepare for pthread_create support of TLS 2019-04-14 13:17:07 -06:00