Parse relocations only once.
authorRafael Espindola <rafael.espindola@gmail.com>
Thu, 10 Nov 2016 14:53:24 +0000 (14:53 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Thu, 10 Nov 2016 14:53:24 +0000 (14:53 +0000)
commit9f0c4bb795f4b194b8597b594c82279d906159c0
treeada80d7201dc6cdbd242f7b864c911180e4842bb
parente93e0adbb537b6fda449a7aca59cda652e0e8cda
Parse relocations only once.

Relocations are the last thing that we wore storing a raw section
pointer to and parsing on demand.

With this patch we parse it only once and store a pointer to the
actual data.

The patch also changes where we store it. It is now in
InputSectionBase. Not all sections have relocations, but most do and
this simplifies the logic. It also means that we now only support one
relocation section per section. Given that that constraint is
maintained even with -r with gold bfd and lld, I think it is OK.

llvm-svn: 286459
lld/ELF/ICF.cpp
lld/ELF/InputFiles.cpp
lld/ELF/InputFiles.h
lld/ELF/InputSection.cpp
lld/ELF/InputSection.h
lld/ELF/MarkLive.cpp
lld/ELF/OutputSections.cpp
lld/ELF/Relocations.cpp
lld/ELF/Relocations.h
lld/ELF/Writer.cpp
lld/test/ELF/invalid/invalid-elf.test