Thanks for the suggestion.
I had already noticed before that the current GNU binutils does not generate
.ARM.exidx.text or .ARM.extab.text for the plain .text section.
GNU as special-cases an exact .text section name in
start_unwind_section():
text_name = segment_name(text_seg);
if (streq(text_name, ".text"))
text_name = "";
And after your reply, I checked LLVM founding it does the same in
ARMELFStreamer::SwitchToEHSection():
StringRef FnSecName(FnSection.getName());
SmallString<128> EHSecName(Prefix);
if (FnSecName != ".text")
EHSecName += FnSecName;
So, with both current implementations, the mapping is:
.text -> .ARM.exidx / .ARM.extab
.text.foo -> .ARM.exidx.text.foo / .ARM.extab.text.foo
It's correct that .ARM.exidx.text and .ARM.extab.text are therefore not
generated by the current GNU or LLVM implementations currently.
My reason for including the exact matches is slightly different.
AAELF32 defines these section namespaces as .ARM.exidx* and
.ARM.extab*; it does not require all ABI-conforming object producers to
use the same naming convention as GNU as and LLVM.
For example, another producer or future version of GNU/LLVM impl for `as`
could validly use:
.text -> .ARM.exidx.text
And our topic is about text section merging in ARM32 unwind section layout.
Without the exact match, .ARM.exidx.text would be left as an orphan
output section, while .ARM.exidx.text.* inputs would be folded into
.ARM.exidx. Since the corresponding .text and .text.* inputs are all
folded into the final .text output section, this would make the unwind
section semantics a little bit asymmetric.
That is my point why prefer to keep `.ARM.exidx.text` matching.
Hear what the other reviewers' comments.