1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 11:17:44 +00:00
serenity/Userland/Libraries/LibELF
Gunnar Beutner cd7512a2ad LibELF: Add support for loading objects with multiple data and text segments
This enables loading executables with multiple data and text segments. Also
it fixes loading executables where the text segment has a non-zero offset.

Example:

  $ echo "main () {}" > test.c
  $ gcc -Wl,-z,separate-code -o test test.c
  $ objdump -p test
  test:     file format elf32-i386

  Program Header:
      PHDR off    0x00000034 vaddr 0x00000034 paddr 0x00000034 align 2**2
           filesz 0x000000e0 memsz 0x000000e0 flags r--
    INTERP off    0x00000114 vaddr 0x00000114 paddr 0x00000114 align 2**0
           filesz 0x00000013 memsz 0x00000013 flags r--
      LOAD off    0x00000000 vaddr 0x00000000 paddr 0x00000000 align 2**12
           filesz 0x000003c4 memsz 0x000003c4 flags r--
      LOAD off    0x00001000 vaddr 0x00001000 paddr 0x00001000 align 2**12
           filesz 0x00000279 memsz 0x00000279 flags r-x
      LOAD off    0x00002000 vaddr 0x00002000 paddr 0x00002000 align 2**12
           filesz 0x00000004 memsz 0x00000004 flags r--
      LOAD off    0x00002004 vaddr 0x00003004 paddr 0x00003004 align 2**12
           filesz 0x00000100 memsz 0x00000124 flags rw-
   DYNAMIC off    0x00002014 vaddr 0x00003014 paddr 0x00003014 align 2**2
           filesz 0x000000c8 memsz 0x000000c8 flags rw-
2021-04-14 13:12:52 +02:00
..
Arch/i386 LibC: Remove text relocation 2021-02-19 09:04:05 +01:00
AuxiliaryVector.h Everywhere: Remove unnecessary clang-format offs 2021-03-04 11:01:48 +01:00
CMakeLists.txt LibELF+LibTest: Fix serenity_install_sources() paths 2021-03-15 09:06:10 +01:00
CoreDump.h Kernel: Set "pledge_violation" coredump metadata in REQUIRE_PROMISE() 2021-01-20 21:01:15 +01:00
DynamicLinker.cpp LibELF: Add support for loading objects with multiple data and text segments 2021-04-14 13:12:52 +02:00
DynamicLinker.h LibELF: Use StringView instead of "const char*" in dynamic linker code 2021-02-20 22:29:12 +01:00
DynamicLoader.cpp LibELF: Add support for loading objects with multiple data and text segments 2021-04-14 13:12:52 +02:00
DynamicLoader.h LibELF: Add support for loading objects with multiple data and text segments 2021-04-14 13:12:52 +02:00
DynamicObject.cpp LibELF: Add support for loading objects with multiple data and text segments 2021-04-14 13:12:52 +02:00
DynamicObject.h LibELF: DynamicObject: Add rpath and runpath helpers 2021-03-22 17:46:05 +01:00
exec_elf.h Libraries: Move to Userland/Libraries/ 2021-01-12 12:17:46 +01:00
Hashes.h LibELF: Move ELF hash functions to their own file (and make constexpr) 2021-02-23 19:43:44 +01:00
Image.cpp LibELF: Convert more string literals to StringView literals. 2021-02-24 14:45:34 +01:00
Image.h LibELF: Don't build barely-used section lookup table in ELF::Image 2021-02-23 19:45:29 +01:00
Validation.cpp LibElf+readelf: Parse ELFs with no program headers correctly 2021-03-29 19:57:19 +02:00
Validation.h Libraries: Add missing headers 2021-01-22 21:49:54 +01:00