Skip to content
Snippets Groups Projects
  1. Jul 19, 2020
  2. Jul 08, 2020
  3. Jun 29, 2020
  4. Jun 27, 2020
  5. Jun 25, 2020
  6. Jun 24, 2020
  7. Jun 23, 2020
  8. Jun 22, 2020
  9. Jun 14, 2020
    • Ahmed Abd El Mawgood's avatar
      Add sys/select.h to sys/types.h · f4d95ce4
      Ahmed Abd El Mawgood authored
      This was triggered by gcc for some reason It included sys/types.h and
      assumed sys/select.h to be there. And that seams to be the case in musl.
      
      The problem with relibc here is that sys/types.h is are part of relibc
      "include/*.h" files, while sys/select.h is generated by cbindgen. That
      makes it impossible to #include select.h in types.h epsecially that
      there are files like fcntl.c that uses types.h. They would complain
      about missing headers. I fixed this by renaming sys/types.h to
      sys/types_internal.h and then generating types.h using cbindgen as well
      except for that. however fcntl and dlmalloc can include types_internal
      instead of types.h
      f4d95ce4
  10. Jun 07, 2020
  11. Jun 03, 2020
  12. May 28, 2020
  13. May 26, 2020
  14. May 24, 2020
  15. May 23, 2020
    • Ahmed Abd El Mawgood's avatar
      Support negative padding size in printf and friends · ee5e2bad
      Ahmed Abd El Mawgood authored
      as it seams you can do something like
              printf ("A%*s%s/\n", -5, "B", "CC");
      and it will print the padding to the left
      ee5e2bad
    • Ahmed Abd El Mawgood's avatar
      Fix off-by-1 error in vfscanf · d7d3e008
      Ahmed Abd El Mawgood authored
      Scanf function requires look ahead to function properly, In case of
      scanning from a buffer that will not be an issue, but in our case we are
      reading from file, so lookaheads needs to be undone (via lseek) in our
      case. The only problem here is that if we opened a file that doesn't
      support lseek such as many of the file /dev/*
      d7d3e008
    • Ahmed Abd El Mawgood's avatar
      Fix bug related to ungetc and ftell() · 1733b3da
      Ahmed Abd El Mawgood authored
      At least in relibc, each call to ungetc should decrement ftell() by one
      also allowing negative ftell() this is not possible on relibc thus gcc
      failing to compile (gcc compiles tools that is later used to compile gcc
      itself and these tools are the ones that fail)
      1733b3da
    • Ahmed Abd El Mawgood's avatar
      Add support for multiple unget at the same time · 7a6f9637
      Ahmed Abd El Mawgood authored
      According to the standards, only one ungetc may be guaranteed however
      glibc allows more than one of those, and to be glibc compatiable, one
      needs to be able to do the same, allowing only 1 ungetc may trigger bug
      while compiling gcc as ungetc is used there alot
      7a6f9637
  16. May 22, 2020
  17. May 08, 2020
  18. Apr 26, 2020
    • Ahmed Abd El Mawgood's avatar
      Implement wcscasecmp and wcsncasecmp · eac69c92
      Ahmed Abd El Mawgood authored
      This patch implements wcscasecmp and wcsncasecmp. These two
      function are required for binutils to link against relibc.
      eac69c92
    • Ahmed Abd El Mawgood's avatar
      Move towlower and towupper to wctype.h and Implement it · 162999ac
      Ahmed Abd El Mawgood authored
      This patch creates wctype.h and impelementat two functions
      that belong to that header file towupper and towlower. These
      functions are building blocks for wcscasecmp and wcsncasecmp
      which are utilized by binutils.
      
      The implementation for towlower and towupper seams to be complex
      so this implementation is mimicking that of musl libc
      162999ac
  19. Apr 24, 2020
    • Ahmed Abd El Mawgood's avatar
      Implement #include<sys/user.h> and #include<sys/procfs.h> · 3a923aa6
      Ahmed Abd El Mawgood authored
      This patch implements sys/user.h file that works for both x86_64 as well
      as aarch64. This include file is used by sys/procfs.h which is needed
      dependency for binutils. There is bug in this patch in aarch64 implementation
      which is the lack of f128 implementation in rust, thus we can't create cbinding
      for long double.
      3a923aa6
  20. Apr 19, 2020
  21. Apr 14, 2020
  22. Apr 07, 2020
    • Ahmed Abd El Mawgood's avatar
      Use Kernel mapped binaries when available. · cc305fc5
      Ahmed Abd El Mawgood authored
      At least in linux kernel, assuming that a.out is an elf that is linked
      against relibc's own ld.so. When a user attempts `./a.out`, Linux kernel
      will map `./a.out`, then map `ld.so` and jump into ld.so entry point.
      In relibc ld.so will simply ignore the kernel mapped a.out and create
      its own mapping. This patch forces relic ld.so to use the already mapped
      `a.out` when ever possible. This would normally have slight performance
      improvement (especially that currently relibc doesn't map a.out but
      instead copy the data into empty mmaped memory).
      
      The real motivation behind this patch is while impelemnting Runtime
      linker debugging protocol for relibc. part of the protocol is ld.so
      inseting address of some ld.so managed data structure into .dynamic
      seciton of a.out then the debugger would check it there. The thing is
      that debuggers have information about the kernel loaded ./a.out and they
      check that one specifically which is in our case totally ignored by
      relibc.
      cc305fc5
Loading