summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-size/llvm-size.cpp
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-02-09 21:30:10 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-02-09 21:30:10 +0000
commit77f6c46922f88cbfe4125b063f4c901a4c4747af (patch)
tree12bee8495e74735ed7a41dd476eb14e58789feb6 /llvm/tools/llvm-size/llvm-size.cpp
parent0e14c044792e464b00ed1303f59a3484bbf4f830 (diff)
downloadbcm5719-llvm-77f6c46922f88cbfe4125b063f4c901a4c4747af.tar.gz
bcm5719-llvm-77f6c46922f88cbfe4125b063f4c901a4c4747af.zip
Revert "Correct size calculations for ELF files"
This reverts commit r259578. There are enough issues with this small patch that it is better to revert and then commit a fixed version (will be committed shortly). llvm-svn: 260285
Diffstat (limited to 'llvm/tools/llvm-size/llvm-size.cpp')
-rw-r--r--llvm/tools/llvm-size/llvm-size.cpp20
1 files changed, 0 insertions, 20 deletions
diff --git a/llvm/tools/llvm-size/llvm-size.cpp b/llvm/tools/llvm-size/llvm-size.cpp
index 5addbb3ea9d..56b9dc58d2e 100644
--- a/llvm/tools/llvm-size/llvm-size.cpp
+++ b/llvm/tools/llvm-size/llvm-size.cpp
@@ -15,13 +15,11 @@
#include "llvm/ADT/APInt.h"
#include "llvm/Object/Archive.h"
-#include "llvm/Object/ELFObjectFile.h"
#include "llvm/Object/MachO.h"
#include "llvm/Object/MachOUniversal.h"
#include "llvm/Object/ObjectFile.h"
#include "llvm/Support/Casting.h"
#include "llvm/Support/CommandLine.h"
-#include "llvm/Support/ELF.h"
#include "llvm/Support/FileSystem.h"
#include "llvm/Support/Format.h"
#include "llvm/Support/ManagedStatic.h"
@@ -113,20 +111,6 @@ static const char *getRadixFmt() {
return nullptr;
}
-/// @brief Remove unneeded ELF sections from calculation
-static bool ConsiderForSize(ObjectFile *Obj, SectionRef Section) {
- if (Obj->isELF()) {
- switch (static_cast<ELFSectionRef>(Section).getType()) {
- case ELF::SHT_NULL:
- case ELF::SHT_SYMTAB:
- case ELF::SHT_STRTAB:
- case ELF::SHT_REL:
- case ELF::SHT_RELA:
- return false;
- }
- }
- return true;
-}
/// @brief Print the size of each Mach-O segment and section in @p MachO.
///
/// This is when used when @c OutputFormat is darwin and produces the same
@@ -303,8 +287,6 @@ static void PrintObjectSectionSizes(ObjectFile *Obj) {
std::size_t max_size_len = strlen("size");
std::size_t max_addr_len = strlen("addr");
for (const SectionRef &Section : Obj->sections()) {
- if (!ConsiderForSize(Obj, Section))
- continue;
uint64_t size = Section.getSize();
total += size;
@@ -340,8 +322,6 @@ static void PrintObjectSectionSizes(ObjectFile *Obj) {
// Print each section.
for (const SectionRef &Section : Obj->sections()) {
- if (!ConsiderForSize(Obj, Section))
- continue;
StringRef name;
if (error(Section.getName(name)))
return;
OpenPOWER on IntegriCloud