[PATCH] D32887: [ELF] Emit __ehdr_start when there is a segment containing program headers

Petr Hosek via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue May 9 12:20:55 PDT 2017


phosek added a comment.

In our dynamic linker to find the image start. That use case is not a problem. We have some special binaries like vDSO which are using custom linker script and later post-processed and it's the post-processing stage I'm concerned about. I'd need to try and see if it's going to handle this.

Outside of our codebase, the main issue I can see (other than implementing semantics that differs from GNU linkers) is in code that uses `__ehdr_start` and uses a linker script. If the linker script is incorrect and the `__ehdr_start` cannot be defined, with GNU linkers they'll get a linker error. If LLD always defines `__ehdr_start`, the code will link but segfault at runtime when you try to access `__ehdr_start`.


Repository:
  rL LLVM

https://reviews.llvm.org/D32887





More information about the llvm-commits mailing list