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)
Sat, Apr 6, 2:08 AM
Unknown Object (File)
Jan 30 2024, 9:21 PM
Unknown Object (File)
Jan 12 2024, 9:55 AM
Unknown Object (File)
Dec 10 2023, 11:13 PM
Unknown Object (File)
Nov 27 2023, 9:18 PM
Unknown Object (File)
Oct 14 2023, 6:57 PM
Unknown Object (File)
Oct 10 2023, 8:03 PM
Unknown Object (File)
Sep 6 2023, 4:46 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 24605
Build 23388: 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.