[PATCH] D54369: [llvm-size][libobject] Add explicit "inTextSegment" methods similar to "isText" section methods to calculate size correctly.

Jordan Rupprecht via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Fri Nov 9 17:19:02 PST 2018


rupprecht created this revision.
rupprecht added reviewers: echristo, Bigcheese, MaskRay.
Herald added a subscriber: llvm-commits.

llvm-size uses "isText()" etc. which seem to indicate whether the section contains code-like things, not whether or not it will actually go in the text segment when in a fully linked executable.

The unit test added (elf-sizes.test) shows some types of sections that cause discrepencies versus the GNU size tool. llvm-size is not correctly reporting sizes of things mapping to text/data segments, at least for ELF files.

This fixes pr38723.


Repository:
  rL LLVM

https://reviews.llvm.org/D54369

Files:
  include/llvm/Object/ELFObjectFile.h
  include/llvm/Object/ObjectFile.h
  lib/Object/ObjectFile.cpp
  test/tools/llvm-size/X86/elf-sizes.test
  test/tools/llvm-size/X86/ignore-sections.s
  tools/llvm-size/llvm-size.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D54369.173478.patch
Type: text/x-patch
Size: 6939 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20181110/afc69887/attachment.bin>


More information about the llvm-commits mailing list