This patch gives elfabi the ability to read DT_NEEDED entries from ELF binaries to populate NeededLibs in TextAPI's ELFStub.
Other than me realizing I made a mistake in previous reviews and a minor little issue (NeededLibCount), this LGTM.
|122 ↗||(On Diff #178779)|
You never use the NeededLibCount. Why do you have it?
|31 ↗||(On Diff #178779)|
|37 ↗||(On Diff #178779)|
|45 ↗||(On Diff #178779)|
|56 ↗||(On Diff #178779)|
Just realized something I should have caught in previous reviews. You don't need these in the headers. You can make them static template functions in just the file they're used in. That reduces .o size and improves the compilers ability to perform optimizations.
|69 ↗||(On Diff #178779)|
|35 ↗||(On Diff #178779)|
nit: remove extraneous space characters?
|130 ↗||(On Diff #178779)|
Is NeededLibs empty on function entry? If so, you can return TargetStub.NeededLibs.count() and remove NeededLibCount variable.
|45–51 ↗||(On Diff #179311)|
Indentation should be 2 spaces.
|148 ↗||(On Diff #179311)|
I think all strings in a string table should be terminated with '\0' in any ELF file. If the last string "overruns" the string table, it is an error, and the last string should not automatically be terminated at the end of the string table.