Skip to content
Snippets Groups Projects
  1. Mar 02, 2021
  2. Feb 23, 2021
  3. Jan 05, 2021
  4. Jan 03, 2021
    • 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
  5. Oct 01, 2020
    • 8tab's avatar
      Fix tls tests for dynamic linker · eee9a80b
      8tab authored
      * 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
      eee9a80b
  6. Sep 30, 2020
  7. Sep 29, 2020
  8. Jul 30, 2020
  9. Jul 08, 2020
  10. Jun 23, 2020
  11. Jun 22, 2020
  12. Jun 03, 2020
  13. May 23, 2020
  14. May 08, 2020
  15. Apr 26, 2020
  16. Apr 14, 2020
  17. Jan 13, 2020
  18. Nov 14, 2019
  19. Sep 18, 2019
  20. Sep 16, 2019
  21. Sep 13, 2019
  22. Aug 17, 2019
  23. Aug 11, 2019
  24. Aug 04, 2019
  25. Jul 18, 2019
  26. Jul 07, 2019
  27. Jul 06, 2019
  28. Jul 01, 2019
  29. Jun 13, 2019
  30. Jun 12, 2019
Loading