Commit Graph

1085 Commits

Author SHA1 Message Date
Jeremy Soller ec0047c864 Fix redox readlink 2022-03-23 13:47:58 -06:00
Jeremy Soller f63d9cefad Add mlock and friends 2022-03-17 14:03:45 -06:00
Jeremy Soller 8a2ff1ec4a Only try to set FS on x86_64 2022-02-13 15:05:07 -07:00
Jeremy Soller 824184a66c Make sure strong symbols are preferred by ld_so 2021-12-15 12:05:21 -07:00
Jeremy Soller ecd934951d R_X86_64_TPOFF64 does not require symbol, allow it to be unset 2021-12-14 14:53:16 -07:00
Jeremy Soller e90fa3e32f Do not try to open traceme on special PIDs 2021-12-01 09:52:31 -07:00
Jeremy Soller c51aec1af6 Workaround waitpid deadlock by making ptrace state thread local 2021-11-30 21:19:48 -07:00
Jeremy Soller 7a8015eb68 Use r10 instead of rcx for linux pte_clone 2021-11-30 11:34:53 -07:00
Jeremy Soller 66615ef449 Use CLONE_THREAD for linux pte_clone 2021-11-30 11:27:02 -07:00
Jeremy Soller 6b46704ac3 Fix netdb stack overuse 2021-11-30 10:30:31 -07:00
Jeremy Soller 65bd3ed1e3 Fixes for program_invocation_name and program_invocation_short_name 2021-11-30 10:27:24 -07:00
Jeremy Soller a50d80ee28 Use anonymous fmap 2021-09-22 20:47:18 -06:00
Jeremy Soller b2dd1f8950 Add cfsetispeed and cfsetospeed stubs for redox 2021-09-14 20:56:35 -06:00
Jeremy Soller ae7cee26a6 Move wctype_t definition to wctype rust header 2021-09-14 20:36:23 -06:00
Jeremy Soller e5d2ba754a Match termios structure to that used in redox_termios 2021-09-13 20:39:40 -06:00
Jeremy Soller dbaeb8f067 Show ld.so expect message 2021-08-10 18:26:09 -06:00
4lDO2 a388b1ae4d Initialize TLS manually on Redox too. 2021-08-05 11:49:40 +02:00
Jeremy Soller b3d71ba8ba Make relibc_panic a weakly linked stub for crt and ld_so objects 2021-08-04 07:20:48 -06:00
Jeremy Soller 753c190995 Implement wctype.h 2021-07-19 10:04:29 -06:00
Jeremy Soller 3f12d8917c Add casecmp source information 2021-07-19 09:37:18 -06:00
Jeremy Soller f8f18ed779 Remove old _wctype module 2021-07-19 09:17:11 -06:00
Jeremy Soller 9f3aa6d4a8 Define wctype_t and wctype 2021-07-19 09:16:56 -06:00
4lDO2 d35c303ef0 Implement chroot as always returning EPERM. 2021-06-17 22:31:39 +02:00
4lDO2 d69c115421 Compile on latest nightly.
This also replaces all the assembly that previously used the AT&T style
with the (in my opinion) superior Intel syntax.

I tried prepending `.att_syntax prefix`, but that did not work...
2021-06-17 22:31:39 +02:00
4lDO2 700c53cf17 Update toolchain to 2021-06-15 2021-06-17 22:31:30 +02:00
Jeremy Soller b472cb87d1 trace ldso path and mmap address 2021-05-10 10:06:55 -06:00
Jeremy Soller 602fd9fe08 Fixes for TCB arch_read on aarch64 2021-04-28 21:29:09 -06:00
Jeremy Soller 075fd5be62 Merge branch 'gmtime-yday-fix' into 'master'
Simplify gmtime_r() day-of-year calculation, correct comment

See merge request redox-os/relibc!311
2021-03-27 16:53:08 +00:00
Peter Limkilde Svendsen 9e8cd0bf07 Centralize page size info in platform abstraction 2021-03-24 00:02:39 +01:00
Jeremy Soller 7012c262f0 Use sched_yield when sleeping with msecs == 0 2021-03-16 21:46:24 -06:00
Jeremy Soller 307cd56824 Merge branch 'fix-tcsetattr' into 'master'
Handle TCSETSW and TCSETSF in ioctl

Closes #168

See merge request redox-os/relibc!324
2021-03-12 18:51:39 +00:00
Noah 49e3e44bf1 Handle TCSETSW and TCSETSF in ioctl 2021-03-12 12:50:17 -06:00
Jeremy Soller 031194b999 Use header files in dlmalloc 2021-02-27 19:12:59 -07:00
Jeremy Soller 6b5706dc95 Merge branch 'time-utc-cast' into 'master'
Use as-less cast for UTC string

See merge request redox-os/relibc!331
2021-02-28 02:06:22 +00:00
Jeremy Soller 6b183aef26 Replace use of int 80h with syscall in __restore_rt 2021-02-27 13:08:48 -07:00
Peter Limkilde Svendsen f49be31762 Use as-less cast 2021-02-19 00:17:24 +01:00
Jeremy Soller e24d27a0b3 Use UTF-8 for redox paths 2021-02-14 14:06:52 -07:00
Jeremy Soller caad589fd1 Merge branch 'bufwriter' into 'master'
Use BufWriter (instead of LineWriter) for FILEs other than stdout and stderr

See merge request redox-os/relibc!328
2021-01-20 15:14:03 +00:00
Jeremy Soller a16f535ee8 Merge branch 'aarch64-fixups' into 'master'
aarch64: TLS arch_read implementation

See merge request redox-os/relibc!330
2021-01-18 22:56:49 +00:00
Robin Randhawa 886f467a75 aarch64: TLS arch_read implementation 2021-01-18 22:01:32 +00:00
Mateusz Tabaka 910fb59006 Change ld.so linker script file name for x86_64 Linux to fix compilation issue 2021-01-14 19:50:36 +01:00
Mateusz Tabaka 02f202ff83 Use BufWriter (instead of LineWriter) for FILEs other than stdout and stderr
BufWriter has more capacity (8k vs 1k) and doesn't flush the stream after '\n'.
That change helps to reduce the number of syscalls, especially when dealing with text files.

Since BufWriter has a different way of getting number of pending elements than LineWriter -
Pending trait was introduced to deal with that.
2021-01-14 18:45:14 +01:00
Jeremy Soller d94e445ae2 Remove Linux search paths from Redox ld_so 2021-01-11 08:52:57 -07:00
Jeremy Soller 3c1300e8ec Improvements for aarch64 support 2021-01-11 08:52:20 -07:00
Jeremy Soller ccee7eae5f Merge branch 'tlssym' into 'master'
Fix dlsym of TLS variables

See merge request redox-os/relibc!327
2021-01-05 23:03:10 +00:00
Mateusz Tabaka 6497d71d2f Fix dlsym of TLS variables 2021-01-05 22:33:22 +01:00
Mateusz Tabaka 6332828725 Call DSO destructors during exit() 2021-01-05 20:39:36 +01:00
Mateusz Tabaka 021a8e00fc Fix stdio/scanf test case
inner_scanf prematurely exited before parsing collected string
2021-01-03 16:07:43 +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 1a0edd8eeb Add program_invocation_short_name 2020-12-23 20:24:04 -07:00