}
void addFileName(StringRef FileName) {
- for (const std::pair<std::string, size_t> &F : FileNames)
- if (F.first == FileName)
- return;
FileNames.emplace_back(std::string(FileName), Symbols.size());
}
StrTabBuilder.finalize();
// Symbols are required to be in lexicographic order.
- //array_pod_sort(LocalSymbolData.begin(), LocalSymbolData.end());
array_pod_sort(ExternalSymbolData.begin(), ExternalSymbolData.end());
// Make the first STT_FILE precede previous local symbols.
# CHECK-NEXT: 7: 0000000000000000 0 NOTYPE LOCAL DEFAULT 6 local1
# CHECK-NEXT: 8: 0000000000000000 0 SECTION LOCAL DEFAULT 8 bar1
# CHECK-NEXT: 9: 0000000000000000 0 NOTYPE LOCAL DEFAULT 8 local2
-# CHECK-NEXT: 10: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 6 bar.c
-# CHECK-NEXT: 11: 0000000000000008 0 NOTYPE GLOBAL DEFAULT 2 foo.c
+# CHECK-NEXT: 10: 0000000000000000 0 FILE LOCAL DEFAULT ABS bar.c
+# CHECK-NEXT: 11: 0000000000000000 0 NOTYPE GLOBAL DEFAULT 6 bar.c
+# CHECK-NEXT: 12: 0000000000000008 0 NOTYPE GLOBAL DEFAULT 2 foo.c
.quad .text
.section bar1,"a"
local2:
.quad bar1
+
+## STT_FILE symbols of the same name are not de-duplicated.
+.file "bar.c"