MCPcopy Create free account
hub / github.com/catboost/catboost / PatchGnuUnique

Function PatchGnuUnique

tools/fix_elf/patch.cpp:200–220  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

198}
199
200void PatchGnuUnique(const TString& path, IOutputStream& verboseOut) {
201 TElf elf(path);
202
203 for (Elf64_Shdr* it = elf.GetSectionBegin(), *end = elf.GetSectionEnd(); it != end; ++it) {
204 if (it->sh_type == SHT_SYMTAB) {
205
206 TSection section{&elf, it};
207 verboseOut << "Found symbol section [" << section.GetName() << ']' << Endl;
208
209 for (size_t i = 0, count = section.GetEntryCount(); i < count; ++i) {
210 Elf64_Sym* symbol = section.GetEntry<Elf64_Sym>(i);
211 auto& info = symbol->st_info;
212
213 if (ELF64_ST_BIND(info) == STB_GNU_UNIQUE) {
214 verboseOut << "Found GNU unique symbol #" << i << Endl;
215 info = ELF64_ST_INFO(STB_GLOBAL, ELF64_ST_TYPE(info));
216 }
217 }
218 }
219 }
220}
221
222int main(int argc, char* argv[]) {
223 bool verbose = false;

Callers 1

mainFunction · 0.85

Calls 4

GetSectionBeginMethod · 0.80
GetSectionEndMethod · 0.80
GetEntryCountMethod · 0.80
GetNameMethod · 0.45

Tested by

no test coverage detected