[PATCH] D23565: [ELF] Linkerscript: fix relocation offsets

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Wed Aug 17 14:16:25 PDT 2016


ruiu added a comment.

Eugene,

Thank you for your description. I agree that the order we compute offset is the cause of the problem. In scanRelocs, we compute a symbol offset for each symbol and assign it to a local variable `Offset` -- but that value may change if linker scripts are in use. That value is computed too early, and we want to do it lazily.

As to this patch, I'd refactor instead of applying a quick fix. It doesn't seem hard to do. For `C.Relocations` in `scanRelocs`, we are able to not store `Offset` to them because it can be computed from `Body`.


https://reviews.llvm.org/D23565





More information about the llvm-commits mailing list