Commit Graph

1590 Commits

Author SHA1 Message Date
Jeremy Soller 7fd366be70 Convert test runner to rust 2021-03-01 21:19:04 -07:00
Jeremy Soller 031194b999 Use header files in dlmalloc 2021-02-27 19:12:59 -07:00
Jeremy Soller a28e9ae378 Add pthreads to includes for C files 2021-02-27 19:11:25 -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 41036ce454 Merge branch 'clocks-per-sec-test' into 'master'
Test for time.h constants

See merge request redox-os/relibc!332
2021-02-28 02:06:13 +00:00
Jeremy Soller 1c1682180f Add generated includes when building C files 2021-02-27 13:34:01 -07: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 e3a0fdbc4a Test for time.h constants 2021-02-23 18:35:24 +01: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
Jeremy Soller f9edc108fa Merge branch 'ldscript' into 'master'
Change ld.so linker script file name for x86_64 Linux to fix compilation issue

See merge request redox-os/relibc!329
2021-01-14 19:24:02 +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 04fd4520d3 Update to redox_syscall 0.2.3 2021-01-11 06:47:23 -07:00
Jeremy Soller c58e9d9589 Update redox_syscall 2021-01-10 10:53:29 -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
Jeremy Soller fb4fa240b7 Merge branch 'destructor' into 'master'
Call DSO destructors during exit()

See merge request redox-os/relibc!326
2021-01-05 23:02:07 +00:00
Mateusz Tabaka 19ac34f2a0 Extend dlfcn tests 2021-01-05 22:48:41 +01: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
Jeremy Soller 261951bcba Merge branch 'globalsyms' into 'master'
Fix global symbols relocations

See merge request redox-os/relibc!325
2021-01-05 01:00:05 +00: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
Jeremy Soller 2f3987dd88 Add _SC_GETPW_R_SIZE_MAX 2020-12-23 19:47:53 -07:00
Jeremy Soller d1ee653b5c Add dirfd 2020-12-23 19:47:44 -07:00
Jeremy Soller 928b18b306 Add sysexits.h 2020-12-23 13:45:25 -07:00
Jeremy Soller 5ae7b7efe7 Use new semaphore to prevent spinning 2020-12-23 12:20:19 -07:00
Jeremy Soller 2f69f0e7f1 Add simple semaphore implementation using futex 2020-12-23 12:18:17 -07:00
Jeremy Soller 79452dbd80 Remove warnings in elf.h 2020-12-23 12:18:02 -07:00
Jeremy Soller bddd69d0c1 Print when abort is called 2020-12-23 11:20:07 -07:00
Jeremy Soller 5efaffe0f9 Ensure that nul test is passed after last commit and failed before 2020-12-23 08:25:44 -07:00
Jeremy Soller 94a6da9116 Fix lookahead buffer reading nul's 2020-12-23 08:20:11 -07:00
Jeremy Soller 07ec3b6591 Merge branch 'mk-subs' into 'master'
Add submodules target to main makefile

See merge request redox-os/relibc!323
2020-10-18 19:48:03 +00:00
hasheddan e5539a570f Add submodules target to main makefile
Adds a submodules convenience target to main makefile. Submodules must
be initialized before other targets can run successfully.

Signed-off-by: hasheddan <georgedanielmangum@gmail.com>
2020-10-18 13:45:29 -05:00
Jeremy Soller 9529e09568 Force overwrite of libc.so.6 if it exists 2020-10-06 11:12:42 -06:00
Jeremy Soller 29e2f29231 Merge branch 'fmt' into 'master'
Fix formatiing issues

See merge request redox-os/relibc!316
2020-10-02 03:22:42 +00:00
Jeremy Soller 3e49323a3a Merge branch 'dlopen' into 'master'
Add support for dlopen(NULL, ...)

See merge request redox-os/relibc!315
2020-10-02 03:21:42 +00:00
Jeremy Soller 21e72cafc6 Merge branch 'tls' into 'master'
Fix tls tests for dynamic linker

See merge request redox-os/relibc!317
2020-10-02 03:20:50 +00:00
Mateusz Tabaka eee9a80baa Fix tls tests for dynamic linker
* load TLS segment for executable - while we can skip PT_LOAD for executable,
  we still have to load TLS segment.
* set TCB address based on if elf is position independent
2020-10-01 15:45:55 +02:00
Mateusz Tabaka 79643c293b Fix formatiing issues 2020-09-30 11:40:38 +02:00
Mateusz Tabaka c11aad71b8 Add support for dlopen(NULL, ...) 2020-09-30 11:04:10 +02:00
Jeremy Soller 687f4d4923 Merge branch 'dynamic' into 'master'
Add tests for ld_so

See merge request redox-os/relibc!314
2020-09-30 00:42:45 +00:00
Mateusz Tabaka 675101ac0e Add tests for dynamic linker 2020-09-29 23:01:52 +02:00
Mateusz Tabaka 7829a7ade9 Add support for RUNPATH 2020-09-29 23:01:48 +02:00