-
Notifications
You must be signed in to change notification settings - Fork 15.1k
Closed
Labels
Description
I think that after this commit dcfa2ab, BOLT might generate invalid constant pool table, due to CU reordering taking place here:
llvm-project/bolt/lib/Core/GDBIndex.cpp
Lines 126 to 132 in b16fe13
| using MapEntry = std::pair<uint32_t, CUInfo>; | |
| std::vector<MapEntry> CUVector(CUMap.begin(), CUMap.end()); | |
| // Need to sort since we write out all of TUs in .debug_info before CUs. | |
| std::sort(CUVector.begin(), CUVector.end(), | |
| [](const MapEntry &E1, const MapEntry &E2) -> bool { | |
| return E1.second.Offset < E2.second.Offset; | |
| }); |
If the reordering did indeed happen, then CU-indexes in the constant pool should be updated, otherwise they point to wrong CUs, right?
cc @ayermolo