When findMemoryRegion do search to find a region for output section it
iterates over MemoryRegions which is DenseMap and so does not
guarantee iteration in insertion order. As a result selected region depends
on its name and not on its definition position
Testcase shows the issue, patch fixes it. Behavior after applying the patch
seems consistent with bfd.
Details
Details
Diff Detail
Diff Detail
- Repository
- rL LLVM
Event Timeline
Comment Actions
- Improved testcase.
- Fixed using of destroyed object happened when doing Script->MemoryRegions[Alias] = Script->MemoryRegions[Name];, where MemoryRegions is MapVector. Right side returned reference to element of internal vector and it was resized and invalidated when called operator[] for left side assignment, so dead value was assigned finally.