Commit Graph

36 Commits

Author SHA1 Message Date
4lDO2 513514a804 fix typo when libc check feature not enabled 2025-11-08 17:35:51 +01:00
4lDO2 3ad0420b85 Add derive macro to check types vs libc crate. 2025-11-08 17:30:34 +01:00
4lDO2 f4cd024c2b Also add align check to projection macro. 2025-10-05 21:53:24 +02:00
4lDO2 24cf96393c Expand Out wrapper and use it in utsname. 2025-10-05 20:01:12 +02:00
Jeremy Soller 82084440ad Support nightly-2025-10-03 2025-10-03 21:51:10 -06:00
Wildan Mubarok c7a1966a67 Fix trace feature 2025-08-08 23:41:07 +00:00
Arne de Bruijn de3dd54266 Fix strtol/ul endptr with detected base
The "0" or "0x" characters with base 0 were not accounted for in the
returned endptr value.
2025-05-02 12:18:34 +02:00
Josh Megnauth 51c04d2470 Use C string literals & deprecate c_str! 2025-03-14 21:17:53 -04:00
Jeremy Soller 02520b194e Fix compilation with trace feature 2025-01-09 12:23:23 -07:00
Anhad Singh 064c7c31c5 feat(dbg): lift the latest version
Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-10 22:15:11 +11:00
Anhad Singh c286ad2868 fix(ld.so): do not depend on TLS at all
In the next big refactor (next PR), all of the platform functionality
used by both relibc and ld.so will be moved into a `platform`/`sysdeps`
crate and then ld.so would be moved out of relibc and not link with it.

I think doing it in a seperate PR would make it more managable, as when
I did half of it, the diff was pretty huge and that way it would be
easier to review too :)

Signed-off-by: Anhad Singh <andypython@protonmail.com>
2024-12-05 23:11:59 +11:00
4lDO2 4eb20628f3 Move some of signal config to redox-rt. 2024-07-09 15:00:52 +02:00
Jacob Lorentzon e0b640d530 Implement new low-level signal trampoline 2024-03-17 16:58:42 +00:00
Peter Limkilde Svendsen a7137512fa Use standard casing and mangling for internal errno 2024-03-01 00:25:42 +00:00
Peter Limkilde Svendsen 9093f6bc47 Use Cell representation for errno 2024-02-29 14:07:40 +00:00
Florian Meißner b66df46f33 strtof(), strtod(): handle NaN and Infinity 2023-06-05 23:04:25 +00:00
Nagy Tibor 5b2a12ca6d strtof, strtod: Fix parsing floats with exponents 2022-07-28 01:11:55 +02: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 05f71567ab Format 2019-07-06 19:37:13 -06:00
jD91mZM2 2f4e57f87a Fix data race inside puts(...) & add dbg!() macro 2019-06-26 21:21:32 +02:00
Jeremy Soller 5dca9843dc Fix use of trace macro when errno is imported 2019-03-27 20:57:12 -06:00
Jeremy Soller c71088e768 Cleanup and format 2019-01-14 21:07:24 -07:00
Jeremy Soller c57ac53d28 Reduce warnings 2019-01-14 19:26:18 -07:00
Jeremy Soller c41c20a943 Allow for static CStr 2019-01-06 14:40:01 -07:00
Jeremy Soller 0ac16556bc Format 2018-11-25 10:34:42 -07:00
Jeremy Soller a5279b648f Fix warnings 2018-11-25 10:34:02 -07:00
Jeremy Soller a29aa9f599 Add execvp 2018-11-16 21:07:24 -07:00
jD91mZM2 6dcc8ee8d9 Implement strtof 2018-10-02 18:47:42 +02:00
Jeremy Soller 9dbf49fdcd Format and add O_CLOEXEC where appropriate 2018-09-18 19:52:47 -06:00
Jeremy Soller 290ecb3e46 - fsync when tracing
- clean up trace macro some
2018-09-18 08:49:44 -06:00
Jeremy Soller 60f00508d3 Restore errno if trace_expr is successful 2018-09-18 08:34:06 -06:00
jD91mZM2 10a7944aef Avoid duplicate code 2018-09-18 08:08:55 +02:00
Jeremy Soller c2f4c1dbc9 Add trace macro and feature 2018-09-17 21:29:40 -06:00
Jeremy Soller 23098b694e Add print, eprint, eprintln, and fix println macros 2018-09-17 15:02:00 -06:00
jD91mZM2 49ccf364c2 Fix netdb getservbyname on names with spaces 2018-09-05 17:38:59 +02:00
Jeremy Soller 277b9abcd5 Fix build, mostly 2018-08-26 08:56:02 -06:00