Skip to content

BOLT: BOLT generates invalid constant pool in .gdb-index #151861

@itrofimow

Description

@itrofimow

I think that after this commit dcfa2ab, BOLT might generate invalid constant pool table, due to CU reordering taking place here:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions