zhuhan0 added a comment.

This doesn't work. The test would fail with

  error: libdynamic-library-test.so: ELF load command address/offset not 
properly aligned

I first used obj2yaml to convert `libdynamic-library-test.so` to YAML, and then 
the test uses yaml2obj to convert it back. But it looks like yaml2obj could not 
generate a loadable shared library. The input library's first load offset 
starts at 0x000:

  LOAD off    0x0000000000000000 vaddr 0x0000000000000000 paddr 
0x0000000000000000 align 2**12
       filesz 0x00000000000004f4 memsz 0x00000000000004f4 flags r--

It contains a padding section before the first real section .dynsym:

  Sections:
  Idx Name                  Size     VMA              Type
    0                       00000000 0000000000000000
    1 .dynsym               000000a8 0000000000000238

But in the output library of yaml2obj, the first load offset does not start at 
0x000 but with the start of .dynsym 0x238

  LOAD off    0x0000000000000238 vaddr 0x0000000000000000 paddr 
0x0000000000000000 align 2**12
       filesz 0x00000000000002bc memsz 0x00000000000002bc flags r--

It's not aligned by 0x1000 and therefore it failed to load.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D147823/new/

https://reviews.llvm.org/D147823

_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to