Skip to content
Snippets Groups Projects
  1. Oct 19, 2023
  2. Oct 14, 2023
  3. Aug 21, 2023
  4. Jun 26, 2023
  5. Jun 05, 2023
  6. Jun 01, 2023
  7. May 29, 2023
  8. May 22, 2023
  9. May 11, 2023
  10. May 10, 2023
  11. May 09, 2023
  12. May 08, 2023
  13. May 06, 2023
  14. Apr 15, 2023
  15. Mar 27, 2023
  16. Mar 26, 2023
  17. Mar 24, 2023
  18. Mar 22, 2023
  19. Dec 17, 2022
  20. Jul 27, 2022
  21. Nov 30, 2021
  22. Mar 02, 2021
  23. Feb 23, 2021
  24. Jan 14, 2021
    • 8tab's avatar
      Use BufWriter (instead of LineWriter) for FILEs other than stdout and stderr · 02f202ff
      8tab authored
      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.
      02f202ff
  25. Jan 05, 2021
  26. Jan 03, 2021
    • 8tab's avatar
      Fix stdio/scanf test case · 021a8e00
      8tab authored
      inner_scanf prematurely exited before parsing collected string
      021a8e00
    • 8tab's avatar
      Fix global symbols relocations · a7480ea6
      8tab authored
      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.
      a7480ea6
Loading