Index: llvm/trunk/tools/llvm-objcopy/Object.cpp =================================================================== --- llvm/trunk/tools/llvm-objcopy/Object.cpp +++ llvm/trunk/tools/llvm-objcopy/Object.cpp @@ -227,10 +227,9 @@ void RelocSectionWithSymtabBase::removeSectionReferences( const SectionBase *Sec) { if (Symbols == Sec) { - error("Symbol table " + Symbols->Name + - " cannot be removed because it is " - "referenced by the relocation " - "section " + + error("Symbol table " + Symbols->Name + " cannot be removed because it is " + "referenced by the relocation " + "section " + this->Name); } } @@ -245,9 +244,9 @@ " is not a symbol table")); if (Info != SHN_UNDEF) - setSection(SecTable.getSection(Info, "Info field value " + Twine(Info) + - " in section " + Name + - " is invalid")); + setSection(SecTable.getSection(Info, + "Info field value " + Twine(Info) + + " in section " + Name + " is invalid")); else setSection(nullptr); } @@ -294,9 +293,8 @@ void SectionWithStrTab::removeSectionReferences(const SectionBase *Sec) { if (StrTab == Sec) { - error("String table " + StrTab->Name + - " cannot be removed because it is " - "referenced by the section " + + error("String table " + StrTab->Name + " cannot be removed because it is " + "referenced by the section " + this->Name); } } @@ -306,9 +304,9 @@ } void SectionWithStrTab::initialize(SectionTableRef SecTable) { - auto StrTab = - SecTable.getSection(Link, "Link field value " + Twine(Link) + - " in section " + Name + " is invalid"); + auto StrTab = SecTable.getSection(Link, + "Link field value " + Twine(Link) + + " in section " + Name + " is invalid"); if (StrTab->Type != SHT_STRTAB) { error("Link field value " + Twine(Link) + " in section " + Name + " is not a string table"); @@ -416,9 +414,9 @@ } } else if (Sym.st_shndx != SHN_UNDEF) { DefSection = SecTable.getSection( - Sym.st_shndx, "Symbol '" + Name + - "' is defined in invalid section with index " + - Twine(Sym.st_shndx)); + Sym.st_shndx, + "Symbol '" + Name + "' is defined in invalid section with index " + + Twine(Sym.st_shndx)); } SymTab->addSymbol(Name, Sym.getBinding(), Sym.getType(), DefSection, Index: llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp =================================================================== --- llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp +++ llvm/trunk/tools/llvm-objcopy/llvm-objcopy.cpp @@ -73,7 +73,7 @@ static cl::opt InputFilename(cl::Positional, cl::desc("")); static cl::opt OutputFilename(cl::Positional, cl::desc(""), - cl::init("-")); + cl::init("-")); static cl::opt OutputFormat("O", cl::desc("Set output format to one of the following:" "\n\tbinary")); @@ -100,8 +100,9 @@ cl::desc("Removes all debug information")); static cl::opt StripSections("strip-sections", cl::desc("Remove all section headers")); -static cl::opt StripNonAlloc("strip-non-alloc", - cl::desc("Remove all non-allocated sections")); +static cl::opt + StripNonAlloc("strip-non-alloc", + cl::desc("Remove all non-allocated sections")); static cl::opt StripDWO("strip-dwo", cl::desc("Remove all DWARF .dwo sections from file")); static cl::opt ExtractDWO( @@ -115,9 +116,7 @@ using SectionPred = std::function; -bool IsDWOSection(const SectionBase &Sec) { - return Sec.Name.endswith(".dwo"); -} +bool IsDWOSection(const SectionBase &Sec) { return Sec.Name.endswith(".dwo"); } template bool OnlyKeepDWOPred(const Object &Obj, const SectionBase &Sec) { @@ -164,8 +163,7 @@ // any previous removals. Lastly whether or not something is removed shouldn't // depend a) on the order the options occur in or b) on some opaque priority // system. The only priority is that keeps/copies overrule removes. -template -void CopyBinary(const ELFObjectFile &ObjFile) { +template void CopyBinary(const ELFObjectFile &ObjFile) { std::unique_ptr> Obj; if (!OutputFormat.empty() && OutputFormat != "binary") @@ -176,7 +174,7 @@ Obj = llvm::make_unique>(ObjFile); if (!SplitDWO.empty()) - SplitDWOToFile(ObjFile, SplitDWO.getValue()); + SplitDWOToFile(ObjFile, SplitDWO.getValue()); SectionPred RemovePred = [](const SectionBase &) { return false; }; @@ -207,7 +205,7 @@ return false; if (&Sec == Obj->getSectionHeaderStrTab()) return false; - switch(Sec.Type) { + switch (Sec.Type) { case SHT_SYMTAB: case SHT_REL: case SHT_RELA: