[PATCH] D82479: [llvm-size] Output REL, RELA and STRTAB sections in some cases

Fangrui Song via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Jun 26 10:23:09 PDT 2020


MaskRay added a comment.

I've verified that GNU size -A:

- omits .symtab/.strtab/.shstrtab . This probably only applies to non-SHF_ALLOC sections
- omits non-SHF_ALLOC .rel{,a}.*
- does not omit non-SHF_ALLOC `.comment`, `__pachable_function_entries`, etc

>From the first two items, I can understand that GNU size has the intention to omit non-SHF_ALLOC sections. However, the third item appears to conflict with the rule. I kind of believe that omitting .symtab/.strtab/.shstrtab may not be an intentional decision because they are special in BFD. The usual section iteration loop may not apply to them (https://sourceware.org/bugzilla/show_bug.cgi?id=26168 ) The logic appears to be some inconsistent rules which I don't very like much.

If you indeed have a specific need that llvm-size -A should match GNU size -A output, I think this patch is fine and is moving toward that goal. If there is no specific need, I'd like to remove SHT_REL & SHT_RELA from the conditions. If we don't want to hide .symtab/.strtab/.shstrtab , that will be even better for me. I can't think of why showing additional 3 entries can be a problem.


CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D82479/new/

https://reviews.llvm.org/D82479





More information about the llvm-commits mailing list