LLVM: lib/ObjCopy/ELF/ELFObjcopy.cpp Source File (original) (raw)

1

2

3

4

5

6

7

8

32#include

33#include

34#include

35#include

36#include

37#include

38#include <system_error>

39#include

40

41using namespace llvm;

46

48

52

56

58

59 if (&Sec == Obj.SectionNames)

60 return false;

61

62

64}

65

84 "section flag SHF_X86_64_LARGE can only be used "

85 "with x86_64 architecture");

87 }

88 return NewFlags;

89}

90

94

95

102 return (OldFlags & PreserveMask) | (NewFlags & ~PreserveMask);

103}

104

112

116 if (!NewFlags)

119

120

121

122

127

129}

130

143

145

146 if (MI.Is64Bit)

148 else

150}

151

155

156 switch (OutputElfType) {

158 return std::make_unique<ELFWriter>(Obj, Out, !Config.StripSections,

161 return std::make_unique<ELFWriter>(Obj, Out, !Config.StripSections,

164 return std::make_unique<ELFWriter>(Obj, Out, !Config.StripSections,

167 return std::make_unique<ELFWriter>(Obj, Out, !Config.StripSections,

169 }

171}

172

178 return std::make_unique(Obj, Out, Config);

180 return std::make_unique(Obj, Out, Config.OutputFilename);

182 return std::make_unique(Obj, Out, Config.OutputFilename);

183 default:

185 }

186}

187

190 for (auto &Sec : Obj.sections()) {

191 if (Sec.Name == SecName) {

194 "cannot dump section '%s': it has no contents",

195 SecName.str().c_str());

198 if (!BufferOrErr)

200 std::unique_ptr Buf = std::move(*BufferOrErr);

201 llvm::copy(Sec.OriginalData, Buf->getBufferStart());

202 if (Error E = Buf->commit())

205 }

206 }

207

209 "section '%s' not found", SecName.str().c_str());

210}

211

213

214

215

217 ToReplace;

219 std::optional CType;

221 if (Matcher.matches(Sec.Name))

222 CType = T;

223

224

230 }

231 if (!CType)

232 continue;

233

234 if (Sec.ParentSegment)

237 "section '" + Sec.Name +

238 "' within a segment cannot be (de)compressed");

239

242 ToReplace.emplace_back(

245 ToReplace.emplace_back(&Sec, [=, S = &Sec] {

248 });

249 }

250 }

251

253 for (auto [S, Func] : ToReplace)

254 FromTo[S] = Func();

256}

257

261 return false;

263 if (!Name.consume_front("$x") && !Name.consume_front("$d"))

264 return false;

265 return Name.empty() || Name.starts_with(".");

266}

267

271 return false;

273 if (!Name.consume_front("$a") && !Name.consume_front("$d") &&

274 !Name.consume_front("$t"))

275 return false;

276 return Name.empty() || Name.starts_with(".");

277}

278

279

281 switch (Obj.Machine) {

283

286

288 default:

289 return false;

290 }

291}

292

294 return !Sym.Referenced &&

297}

298

301

302

303 if (!Obj.SymbolTable)

305

306 Obj.SymbolTable->updateSymbols([&](Symbol &Sym) {

308 return;

309

310

311

312 if (!Sym.isCommon() && Sym.getShndx() != SHN_UNDEF &&

317

319 if (Matcher.matches(Sym.Name))

320 Sym.Visibility = Visibility;

321

322

323

324

325

326

327

328

329

330

331

336

340

341

344

348

351 Sym.Name = std::string(I->getValue());

352

356

358 Sym.Name = (Config.SymbolsPrefix + Sym.Name).str();

359 });

360

361

362

363

367 Sec.markSymbols();

368 }

369

370 auto RemoveSymbolsPred = [&](const Symbol &Sym) {

373 return false;

374

376 return true;

377

379 return true;

380

382 return false;

383

385 return true;

386

390 return true;

391

392 if (!Sym.Referenced) {

398 return true;

399

400

402 return true;

403 }

404

405 return false;

406 };

407

408 return Obj.removeSymbols(RemoveSymbolsPred);

409}

410

414

415

417 RemovePred = [&Config](const SectionBase &Sec) {

419 };

420 }

421

423 RemovePred = [RemovePred](const SectionBase &Sec) {

425 };

426

428 RemovePred = [RemovePred, &Obj](const SectionBase &Sec) {

430 };

431

433 RemovePred = [RemovePred, &Obj](const SectionBase &Sec) {

434 if (RemovePred(Sec))

435 return true;

436 if ((Sec.Flags & SHF_ALLOC) != 0)

437 return false;

438 if (&Sec == Obj.SectionNames)

439 return false;

440 switch (Sec.Type) {

445 return true;

446 }

448 };

449

451 RemovePred = [RemovePred](const SectionBase &Sec) {

452 return RemovePred(Sec) || Sec.ParentSegment == nullptr;

453 };

454 }

455

457 RemovePred = [RemovePred](const SectionBase &Sec) {

459 };

460 }

461

463 RemovePred = [RemovePred, &Obj](const SectionBase &Sec) {

464 if (RemovePred(Sec))

465 return true;

466 if (&Sec == Obj.SectionNames)

467 return false;

468 return (Sec.Flags & SHF_ALLOC) == 0 && Sec.ParentSegment == nullptr;

469 };

470

472 RemovePred = [RemovePred, &Obj](const SectionBase &Sec) {

473 if (RemovePred(Sec))

474 return true;

475 if (&Sec == Obj.SectionNames)

476 return false;

478 return false;

480 return false;

481

482

483

484

486 return false;

487 if (Sec.ParentSegment != nullptr)

488 return false;

489 return (Sec.Flags & SHF_ALLOC) == 0;

490 };

491

493 RemovePred = [RemovePred](const SectionBase &Sec) {

494 if (RemovePred(Sec))

495 return true;

497 return true;

498 return (Sec.Flags & SHF_ALLOC) != 0 && !Sec.ParentSegment;

499 };

500 }

501

502

504 RemovePred = [&Config, RemovePred, &Obj](const SectionBase &Sec) {

505

507 return false;

508

509

510 if (RemovePred(Sec))

511 return true;

512

513

514 if (Obj.SectionNames == &Sec)

515 return false;

516 if (Obj.SymbolTable == &Sec ||

517 (Obj.SymbolTable && Obj.SymbolTable->getStrTab() == &Sec))

518 return false;

519

520

521 return true;

522 };

523 }

524

526 RemovePred = [&Config, RemovePred](const SectionBase &Sec) {

527

529 return false;

530

531 return RemovePred(Sec);

532 };

533 }

534

535

536

537

538

539

541 Obj.SymbolTable && !Obj.SymbolTable->empty()) {

542 RemovePred = [&Obj, RemovePred](const SectionBase &Sec) {

543 if (&Sec == Obj.SymbolTable || &Sec == Obj.SymbolTable->getStrTab())

544 return false;

545 return RemovePred(Sec);

546 };

547 }

548

550 return E;

551

552 if (Error E = Obj.compressOrDecompressSections(Config))

553 return E;

554

556}

557

558

560 uint8_t DefaultVisibility) {

563

566 uint8_t Visibility = DefaultVisibility;

567

569 switch (FlagValue) {

572 break;

575 break;

578 break;

581 break;

584 break;

587 break;

590 break;

593 break;

596 break;

599 break;

602 break;

603 default:

604 break;

605 };

606

607 Obj.SymbolTable->addSymbol(

610}

611

612namespace {

613struct RemoveNoteDetail {

614 struct DeletedRange {

615 uint64_t OldFrom;

616 uint64_t OldTo;

617 };

618

619 template

620 static std::vector

621 findNotesToRemove(ArrayRef<uint8_t> Data, size_t Align,

623 static std::vector<uint8_t> updateData(ArrayRef<uint8_t> OldData,

625};

626}

627

628template

629std::vectorRemoveNoteDetail::DeletedRange

630RemoveNoteDetail::findNotesToRemove(ArrayRef<uint8_t> Data, size_t Align,

632 using Elf_Nhdr = typename ELFT::Nhdr;

633 using Elf_Note = typename ELFT::Note;

634 std::vector ToRemove;

635 uint64_t CurPos = 0;

636 while (CurPos + sizeof(Elf_Nhdr) <= Data.size()) {

637 auto Nhdr = reinterpret_cast<const Elf_Nhdr *>(Data.data() + CurPos);

638 size_t FullSize = Nhdr->getSize(Align);

639 if (CurPos + FullSize > Data.size())

640 break;

641 Elf_Note Note(*Nhdr);

642 bool ShouldRemove =

643 llvm::any_of(NotesToRemove, [&Note](const RemoveNoteInfo &NoteInfo) {

644 return NoteInfo.TypeId == Note.getType() &&

646 });

647 if (ShouldRemove)

648 ToRemove.push_back({CurPos, CurPos + FullSize});

649 CurPos += FullSize;

650 }

652}

653

654std::vector<uint8_t>

655RemoveNoteDetail::updateData(ArrayRef<uint8_t> OldData,

657 std::vector<uint8_t> NewData;

658 NewData.reserve(OldData.size());

659 uint64_t CurPos = 0;

660 for (const DeletedRange &RemRange : ToRemove) {

661 if (CurPos < RemRange.OldFrom) {

662 auto Slice = OldData.slice(CurPos, RemRange.OldFrom - CurPos);

664 }

665 CurPos = RemRange.OldTo;

666 }

667 if (CurPos < OldData.size()) {

668 auto Slice = OldData.slice(CurPos);

670 }

671 return NewData;

672}

673

677

678 if (ErrorCallback) {

679 for (Segment &Seg : Obj.segments()) {

680 if (Seg.Type == PT_NOTE) {

683 return E;

684 break;

685 }

686 }

687 }

688 for (auto &Sec : Obj.sections()) {

689 if (Sec.Type != SHT_NOTE || !Sec.hasContents())

690 continue;

691

692 if (Sec.ParentSegment) {

693 if (ErrorCallback)

696 "cannot remove note(s) from " + Sec.Name +

697 ": sections in segments are not supported")))

698 return E;

699 continue;

700 }

702 size_t Align = std::max<size_t>(4, Sec.Align);

703

704

706 ? RemoveNoteDetail::findNotesToRemove(

707 OldData, Align, NotesToRemove)

708 : RemoveNoteDetail::findNotesToRemove(

709 OldData, Align, NotesToRemove);

711 if (Error E = Obj.updateSectionData(

712 Sec, RemoveNoteDetail::updateData(OldData, ToRemove)))

713 return E;

714 }

715 }

717}

718

727

730

731

732

733

734

735

736

737 if (Data.empty())

739

740 if (Data.size() < 12) {

741 std::string msg;

743 << Name << " data must be either empty or at least 12 bytes long";

745 }

746 if (Data.size() % 4 != 0) {

747 std::string msg;

749 << Name << " data size must be a multiple of 4 bytes";

751 }

754

757

759 4 + 4 + 4 +

760 alignTo(NameSizeValue, 4) +

761 alignTo(DescSizeValue, 4);

763 if (ActualDataSize != ExpectedDataSize) {

764 std::string msg;

766 << Name

767 << " data size is incompatible with the content of "

768 "the name and description size fields:"

769 << " expecting " << ExpectedDataSize << ", found " << ActualDataSize;

771 }

772

774}

775

776

777

778

779

780

781

782

786 Obj.Machine = Config.OutputArch->EMachine;

787 Obj.OSABI = Config.OutputArch->OSABI;

788 }

789

791 return Obj.removeSections(

793 [&Obj](const SectionBase &Sec) { return onlyKeepDWOPred(Obj, Sec); });

794 }

795

796

800 std::tie(SectionName, FileName) = Flag.split('=');

803 return E;

804 }

805

806

807

808

809

812

815

817 for (SectionBase &Sec : Obj.sections()) {

820 Sec.Align = I->second;

821 }

822 }

823

825 for (Segment &Seg : Obj.segments()) {

826 if (Seg.MemSize > 0) {

828 Seg.PAddr > std::numeric_limits<uint64_t>::max() -

833 " cannot be increased by 0x" +

835 ". The result would overflow");

837 Seg.PAddr < std::numeric_limits<uint64_t>::min() -

842 " cannot be decreased by 0x" +

844 ". The result would underflow");

845 }

847 }

848 }

849 }

850

855 "cannot change section address in a non-relocatable file");

859 for (SectionBase &Sec : Obj.sections()) {

860 if (PatternUpdate.SectionPattern.matches(Sec.Name) &&

861 SectionsToUpdateAddress.try_emplace(Sec.Name, PatternUpdate.Update)

862 .second) {

864 Sec.Addr < PatternUpdate.Update.Value) {

868 " cannot be decreased by 0x" +

870 ". The result would underflow");

871 }

873 Sec.Addr > std::numeric_limits<uint64_t>::max() -

874 PatternUpdate.Update.Value) {

878 " cannot be increased by 0x" +

880 ". The result would overflow");

881 }

882

883 switch (PatternUpdate.Update.Kind) {

885 Sec.Addr = PatternUpdate.Update.Value;

886 break;

888 Sec.Addr -= PatternUpdate.Update.Value;

889 break;

891 Sec.Addr += PatternUpdate.Update.Value;

892 break;

893 }

894 }

895 }

896 }

897 }

898

900 for (auto &Sec : Obj.sections())

903

907

912 }

913

918 if (Name.starts_with(".note") && Name != ".note.GNU-stack") {

922 }

924 };

927 }

928

931 return Obj.updateSection(Name, Data);

932 };

935 }

936

940

941

942

943 if (!Obj.SymbolTable && !Config.SymbolsToAdd.empty())

944 if (Error E = Obj.addNewSymbolTable())

946

949

950

952 for (auto &Sec : Obj.sections()) {

958 }

962 }

963 }

964

966 std::vector<RelocationSectionBase *> RelocSections;

968 for (SectionBase &Sec : Obj.sections()) {

973 Sec.Name = std::string(SR.NewName);

977 }

978 RenamedSections.insert(&Sec);

979 } else if (RelocSec && !(Sec.Flags & SHF_ALLOC))

980

981

982

983

984

985

986 RelocSections.push_back(RelocSec);

987 }

988

989

991 auto Iter = RenamedSections.find(RelocSec->getSection());

992 if (Iter != RenamedSections.end())

993 RelocSec->Name = (RelocSec->getNamePrefix() + (*Iter)->Name).str();

994 }

995 }

996

997

998

999

1002 for (SectionBase &Sec : Obj.sections()) {

1005 PrefixedSections.insert(&Sec);

1007

1008

1009

1010

1011

1012

1013

1014 const SectionBase *TargetSec = RelocSec->getSection();

1016

1017

1018

1019

1020 if (PrefixedSections.count(TargetSec))

1021 Sec.Name = (RelocSec->getNamePrefix() + TargetSec->Name).str();

1022 else

1024 TargetSec->Name)

1025 .str();

1026 }

1027 }

1028 }

1029 }

1030

1034}

1035

1038 std::unique_ptr Writer =

1039 createWriter(Config, Obj, Out, OutputElfType);

1041 return E;

1043}

1044

1050 if (!Obj)

1051 return Obj.takeError();

1052

1053 const ElfType OutputElfType =

1056 return E;

1057 return writeOutput(Config, **Obj, Out, OutputElfType);

1058}

1059

1066 if (!Obj)

1067 return Obj.takeError();

1068

1069

1070

1071 const ElfType OutputElfType =

1074 return E;

1075 return writeOutput(Config, **Obj, Out, OutputElfType);

1076}

1077

1085 if (!Obj)

1086 return Obj.takeError();

1087

1091

1093 return E;

1094

1095 if (Error E = writeOutput(Config, **Obj, Out, OutputElfType))

1097

1099}

ReachingDefInfo InstSet & ToRemove

static GCRegistry::Add< CoreCLRGC > E("coreclr", "CoreCLR-compatible GC")

This file defines the DenseSet and SmallDenseSet classes.

static Error removeNotes(Object &Obj, endianness Endianness, ArrayRef< RemoveNoteInfo > NotesToRemove, function_ref< Error(Error)> ErrorCallback)

Definition ELFObjcopy.cpp:674

static Error replaceAndRemoveSections(const CommonConfig &Config, const ELFConfig &ELFConfig, Object &Obj)

Definition ELFObjcopy.cpp:411

static bool isArmMappingSymbol(const Symbol &Sym)

Definition ELFObjcopy.cpp:268

static Error handleArgs(const CommonConfig &Config, const ELFConfig &ELFConfig, ElfType OutputElfType, Object &Obj)

Definition ELFObjcopy.cpp:783

static Error handleUserSection(const NewSectionInfo &NewSection, function_ref< Error(StringRef, ArrayRef< uint8_t >)> F)

Definition ELFObjcopy.cpp:720

static void addSymbol(Object &Obj, const NewSymbolInfo &SymInfo, uint8_t DefaultVisibility)

Definition ELFObjcopy.cpp:559

static Error updateAndRemoveSymbols(const CommonConfig &Config, const ELFConfig &ELFConfig, Object &Obj)

Definition ELFObjcopy.cpp:299

std::function< bool(const SectionBase &Sec)> SectionPred

Definition ELFObjcopy.cpp:47

static Error verifyNoteSection(StringRef Name, endianness Endianness, ArrayRef< uint8_t > Data)

Definition ELFObjcopy.cpp:728

static bool isDWOSection(const SectionBase &Sec)

Definition ELFObjcopy.cpp:53

static bool isRequiredByABISymbol(const Object &Obj, const Symbol &Sym)

Definition ELFObjcopy.cpp:280

static bool isDebugSection(const SectionBase &Sec)

Definition ELFObjcopy.cpp:49

static Error dumpSectionToFile(StringRef SecName, StringRef Filename, StringRef InputFilename, Object &Obj)

Definition ELFObjcopy.cpp:188

static Error writeOutput(const CommonConfig &Config, Object &Obj, raw_ostream &Out, ElfType OutputElfType)

Definition ELFObjcopy.cpp:1036

static bool isUnneededSymbol(const Symbol &Sym)

Definition ELFObjcopy.cpp:293

static bool isAArch64MappingSymbol(const Symbol &Sym)

Definition ELFObjcopy.cpp:258

static bool onlyKeepDWOPred(const Object &Obj, const SectionBase &Sec)

Definition ELFObjcopy.cpp:57

static void setSectionType(SectionBase &Sec, uint64_t Type)

Definition ELFObjcopy.cpp:105

static Expected< uint64_t > getNewShfFlags(SectionFlag AllFlags, uint16_t EMachine)

Definition ELFObjcopy.cpp:66

static Error setSectionFlagsAndType(SectionBase &Sec, SectionFlag Flags, uint16_t EMachine)

Definition ELFObjcopy.cpp:113

static std::unique_ptr< Writer > createELFWriter(const CommonConfig &Config, Object &Obj, raw_ostream &Out, ElfType OutputElfType)

Definition ELFObjcopy.cpp:152

static uint64_t getSectionFlagsPreserveMask(uint64_t OldFlags, uint64_t NewFlags, uint16_t EMachine)

Definition ELFObjcopy.cpp:91

static std::unique_ptr< Writer > createWriter(const CommonConfig &Config, Object &Obj, raw_ostream &Out, ElfType OutputElfType)

Definition ELFObjcopy.cpp:173

static ElfType getOutputElfType(const Binary &Bin)

Definition ELFObjcopy.cpp:131

static cl::opt< std::string > InputFilename(cl::Positional, cl::desc(""), cl::init("-"))

This file defines the SmallVector class.

ArrayRef - Represent a constant reference to an array (0 or more elements consecutively in memory),...

size_t size() const

size - Get the array size.

ArrayRef< T > slice(size_t N, size_t M) const

slice(n, m) - Chop off the first N elements of the array, and keep M elements in the array.

Implements a dense probed hash-table based set.

Lightweight error class with error context and mandatory checking.

static ErrorSuccess success()

Create a success value.

Tagged union holding either a T or a Error.

Error takeError()

Take ownership of the stored error.

static LLVM_ABI Expected< std::unique_ptr< FileOutputBuffer > > create(StringRef FilePath, size_t Size, unsigned Flags=0)

Factory method to create an OutputBuffer object which manages a read/write buffer of the specified si...

This interface provides simple read-only access to a block of memory, and provides simple methods for...

This is a 'vector' (really, a variable-sized array), optimized for the case when the array is small.

StringMap - This is an unconventional map that is specialized for handling keys that are "strings",...

iterator find(StringRef Key)

std::pair< iterator, bool > try_emplace(StringRef Key, ArgsTy &&...Args)

Emplace a new element for the specified key into the map if the key isn't already in the map.

StringRef - Represent a constant reference to a string, i.e.

std::string str() const

str - Get the contents as an std::string.

bool starts_with(StringRef Prefix) const

Check if this string starts with the given Prefix.

constexpr bool empty() const

empty - Check if the string is empty.

constexpr size_t size() const

size - Get the string size.

bool ends_with(StringRef Suffix) const

Check if this string ends with the given Suffix.

static Twine utohexstr(uint64_t Val)

The instances of the Type class are immutable: once they are created, they are never changed.

LLVM Value Representation.

std::pair< iterator, bool > insert(const ValueT &V)

iterator find(const_arg_type_t< ValueT > V)

size_type count(const_arg_type_t< ValueT > V) const

Return 1 if the specified key is in the set, 0 otherwise.

An efficient, type-erasing, non-owning reference to a callable.

bool matches(StringRef S) const

SectionTableRef sections() const

T & addSection(Ts &&...Args)

Error compressOrDecompressSections(const CommonConfig &Config)

Definition ELFObjcopy.cpp:212

Error replaceSections(const DenseMap< SectionBase *, SectionBase * > &FromTo)

virtual Expected< std::unique_ptr< Object > > create(bool EnsureSymtab) const =0

virtual Error finalize()=0

This class implements an extremely fast bulk output stream that can only output to a stream.

A raw_ostream that writes to an std::string.

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

constexpr size_t NameSize

LLVM_ABI Error executeObjcopyOnIHex(const CommonConfig &Config, const ELFConfig &ELFConfig, MemoryBuffer &In, raw_ostream &Out)

Apply the transformations described by Config and ELFConfig to In, which must represent an IHex file,...

Definition ELFObjcopy.cpp:1045

LLVM_ABI Error executeObjcopyOnBinary(const CommonConfig &Config, const ELFConfig &ELFConfig, object::ELFObjectFileBase &In, raw_ostream &Out)

Apply the transformations described by Config and ELFConfig to In and writes the result into Out.

Definition ELFObjcopy.cpp:1078

LLVM_ABI Error executeObjcopyOnRawBinary(const CommonConfig &Config, const ELFConfig &ELFConfig, MemoryBuffer &In, raw_ostream &Out)

Apply the transformations described by Config and ELFConfig to In, which is treated as a raw binary i...

Definition ELFObjcopy.cpp:1060

uint32_t read32(const void *P, endianness E)

This is an optimization pass for GlobalISel generic memory operations.

Error createFileError(const Twine &F, Error E)

Concatenate a source file path and/or name with an Error.

decltype(auto) dyn_cast(const From &Val)

dyn_cast - Return the argument parameter cast to the specified type.

void append_range(Container &C, Range &&R)

Wrapper function to append range R to container C.

Error createStringError(std::error_code EC, char const *Fmt, const Ts &... Vals)

Create formatted StringError object.

bool any_of(R &&range, UnaryPredicate P)

Provide wrappers to std::any_of which take ranges instead of having to pass begin/end explicitly.

auto reverse(ContainerTy &&C)

bool isa(const From &Val)

isa - Return true if the parameter to the template is an instance of one of the template type argu...

FunctionAddr VTableAddr uintptr_t uintptr_t Data

uint64_t alignTo(uint64_t Size, Align A)

Returns a multiple of A needed to store Size bytes.

ArrayRef(const T &OneElt) -> ArrayRef< T >

OutputIt copy(R &&Range, OutputIt Out)

SymInfo contains information about symbol: it's address and section index which is -1LL for absolute ...

This struct is a compact representation of a valid (non-zero power of two) alignment.

SmallVector< SectionPatternAddressUpdate, 0 > ChangeSectionAddress

SmallVector< NewSectionInfo, 0 > UpdateSection

NameMatcher SymbolsToGlobalize

int64_t ChangeSectionLMAValAll

StringMap< SectionRename > SectionsToRename

NameMatcher SymbolsToRemove

std::optional< MachineInfo > OutputArch

SmallVector< std::pair< NameMatcher, llvm::DebugCompressionType >, 0 > compressSections

bool ExtractMainPartition

bool DecompressDebugSections

SmallVector< StringRef, 0 > DumpSection

SmallVector< NewSymbolInfo, 0 > SymbolsToAdd

NameMatcher SymbolsToKeep

StringRef AddGnuDebugLink

StringMap< uint64_t > SetSectionAlignment

NameMatcher SymbolsToWeaken

uint32_t GnuDebugLinkCRC32

NameMatcher SymbolsToKeepGlobal

DebugCompressionType CompressionType

std::function< Error(Error)> ErrorCallback

StringMap< SectionFlagsUpdate > SetSectionFlags

NameMatcher SymbolsToSkip

SmallVector< NewSectionInfo, 0 > AddSection

NameMatcher UnneededSymbolsToRemove

StringRef SymbolsPrefixRemove

std::optional< StringRef > ExtractPartition

StringRef AllocSectionsPrefix

StringMap< StringRef > SymbolsToRename

NameMatcher SymbolsToLocalize

StringMap< uint64_t > SetSectionType

std::vector< std::pair< NameMatcher, uint8_t > > SymbolsToSetVisibility

uint8_t NewSymbolVisibility

SmallVector< RemoveNoteInfo, 0 > NotesToRemove

std::function< uint64_t(uint64_t)> EntryExpr

std::shared_ptr< MemoryBuffer > SectionData

std::optional< SectionFlag > NewFlags