summaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2022-04-03Handle case of NULL dlpi_nameHEADmasterMatt Turner
Apparently this can happen on some versions of Android. Fixed in Mesa with commit 70d25cae8b9 ("util/build-id: check dlpi_name before strstr call"). Closes: https://github.com/mattst88/build-id/issues/5
2020-06-24Remove usage of bash '&>' redirectionNeil Roza
On systems where /bin/sh is dash, this would lead to empty *.expected and *.results files and thus make check would always succeed. Closes: #1
2020-03-28README.md: Wordsmithing, formatting improvementsMatt Turner
2020-03-25Add README.MD and LICENSEMatt Turner
2020-03-24Always build with -fPICMatt Turner
The dladdr(3) explains that dladdr often doesn't do what you expect because the function pointer will point to the PLT entry in the original object and not the actual function itself.
2019-04-25Test that by_symbol returns the same nhdr as by_nameMatt Turner
2019-04-25Fix address comparison for binaries with LOAD vaddr > 0Matt Turner
Cherry-picked from Mesa commit 02e2009b929a (util/build-id: Fix address comparison for binaries with LOAD vaddr > 0) by Stephan Gerhold.
2019-04-25Add a program using dlopenMatt Turner
2019-04-25Add a check target to the MakefileMatt Turner
2017-11-25Add macros to build on OpenBSDMatt Turner
From upstream Mesa commit a042465c218e ("util/build-id: define ElfW and NT_GNU_BUILD_ID if needed")
2017-11-24Add build_id_find_nhdr_by_symbol()Matt Turner
2017-11-24Add "by_name" to function nameMatt Turner
In preparation for adding a "by_symbol" equivalent.
2017-11-24Simplify code structure to match upstream MesaMatt Turner
2017-11-24Rename "note" to "build_id_note" to avoid potential collisionsMatt Turner
2017-11-24Change API to match upstream MesaMatt Turner
2017-11-24Add .gitignoreMatt Turner
2017-02-14Remove unused headers.Matt Turner
2016-12-14Use dl_iterate_phdr() instead of a linker script.Matt Turner
According to Mike Frysinger [1] it is not reliable to read ELF sections at runtime, which the previous method involving the linker script was doing. Instead, use dl_iterate_phdr() to find the build id. [1] https://sourceware.org/ml/binutils/2016-12/msg00207.html
2016-12-08Make the linker script work.Matt Turner
Previously the build-id program (which was reading its own build-id worked) but the so-build-id program (was was reading the linked DSO's build id) did not. I speculated that the __note_gnu_build_id_start symbol was not being relocated properly since its address in the DSO was somewhat before the .text section, while the __note_gnu_build_id_end symbol was correct. I could even read the build-id which ended at the end symbol. I noticed that in the output of "ld --verbose" that there is only a ".interp" section immediately before .note.gnu.build-id, while in "ld --verbose -shared" there is nothing before .note.gnu.build-id. I think that probably points to the problem, but I am not sure exactly what it is.
2016-12-08Initial commitMatt Turner