Page MenuHomeFreeBSD

strip: Use libelftc_string_table to manage the section string table.
ClosedPublic

Authored by markj on May 30 2019, 5:04 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Dec 19, 3:17 PM
Unknown Object (File)
Sat, Nov 30, 6:34 PM
Unknown Object (File)
Mon, Nov 25, 1:40 AM
Unknown Object (File)
Nov 23 2024, 12:36 PM
Unknown Object (File)
Nov 20 2024, 9:03 AM
Unknown Object (File)
Nov 7 2024, 9:51 AM
Unknown Object (File)
Oct 23 2024, 9:30 AM
Unknown Object (File)
Oct 23 2024, 9:30 AM
Subscribers

Details

Summary

This replaces some hand-rolled routines. libelftc uses a hash table to
speed up lookups, so this ends up being way faster.

The previous implementation does suffix matching, which libelftc does
not. However, I think this is fine; in general it is unlikely that one
section's name is a suffix of another. For .strtab we'd want to do
suffix matching.

Diff Detail

Lint
No Lint Coverage
Unit
No Test Coverage
Build Status
Buildable 24669
Build 23441: arc lint + arc unit

Event Timeline

Destroy the section string table before destroying the corresponding
ELF section descriptor.

The previous implementation does suffix matching, which libelftc does not. However, I think this is fine; in general it is unlikely that one section's name is a suffix of another. For .strtab we'd want to do suffix matching.

I agree this is probably fine - suffix matching can come into play with -ffunction-sections but in that case it's an entry in strtab that's a suffix of the section name.

The previous implementation does suffix matching, which libelftc does not. However, I think this is fine; in general it is unlikely that one section's name is a suffix of another. For .strtab we'd want to do suffix matching.

I agree this is probably fine - suffix matching can come into play with -ffunction-sections but in that case it's an entry in strtab that's a suffix of the section name.

It also would not be too hard to add it to libelftc_string_table, especially since we are allowed to break the API. Before finalizing the string table image, qsort() the entries by reverse alphabetical order and do matching on adjacent entries.

qsort() the entries by reverse alphabetical order

I mean, sort by treating the end of the string as most significant instead of least significant.

This revision is now accepted and ready to land.Jun 4 2019, 6:17 PM
This revision was automatically updated to reflect the committed changes.