[PATCH] D131309: [ELF] Add ability to get a symbol by name from the hash table section

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Aug 18 15:34:35 PDT 2022


MaskRay added a comment.

Thanks for the information about mips.
For Linux, I think for `x` years non-mips distributions have shipped executables with both DT_HASH and DT_GNU_HASH,
for `16-x` years, these distributions ship executables with only DT_GNU_HASH.

For example, Go vdso used to support DT_HASH but in 2017 they noticed that DT_GNU_HASH had to be supported: https://go-review.git.corp.google.com/c/go/+/45511/

Nowadays, there are some `--hash-style=sysv` uses which are all mips specific or ancient tech debt.
AIUI your patch does not need to deal with such ancient objects.
mips is in a weird situation as it uses a technique from last century to sort .dynsym. The .dynsym sorting is incompatible with DT_GNU_HASH.
(https://maskray.me/blog/2021-08-29-all-about-global-offset-table#dt_mips_local_gotno-and-dt_mips_symtabno-dt_mips_gotsym)


Repository:
  rG LLVM Github Monorepo

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

https://reviews.llvm.org/D131309



More information about the llvm-commits mailing list