blob: ba3e2ef8ba42003cfe4ccad2e50ec0e5398b73c7 [file] [log] [blame]
Seiya Nutaf923d9b2019-06-21 00:21:50 +00001#include "Object.h"
2#include "../llvm-objcopy.h"
3
4namespace llvm {
5namespace objcopy {
6namespace macho {
7
8const SymbolEntry *SymbolTable::getSymbolByIndex(uint32_t Index) const {
9 assert(Index < Symbols.size() && "invalid symbol index");
10 return Symbols[Index].get();
11}
12
Seiya Nuta7f19dd12019-10-28 15:40:37 +090013void Object::removeSections(function_ref<bool(const Section &)> ToRemove) {
14 for (LoadCommand &LC : LoadCommands)
15 LC.Sections.erase(std::remove_if(std::begin(LC.Sections),
16 std::end(LC.Sections), ToRemove),
17 std::end(LC.Sections));
18}
19
Seiya Nutaf923d9b2019-06-21 00:21:50 +000020} // end namespace macho
21} // end namespace objcopy
22} // end namespace llvm