ruiu added a comment. I wonder if you can make a guess on how many relocations will be inserted to the vector. We know the number of relocations for each input section, so calling reserve() might work. https://reviews.llvm.org/D46145