diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-02-11 01:40:49 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-02-11 01:40:49 +0000 |
commit | 08d6a3f1337238a480225d4caf71b8fec10dc8c6 (patch) | |
tree | 4e9d116916fe04368eeaab946936390db21fe2f2 /llvm/lib/Bitcode/Reader/BitcodeReader.cpp | |
parent | f11ab87ba397e7dc1d601c9981607d3bdf8d51a3 (diff) | |
download | llvm-08d6a3f1337238a480225d4caf71b8fec10dc8c6.zip llvm-08d6a3f1337238a480225d4caf71b8fec10dc8c6.tar.gz llvm-08d6a3f1337238a480225d4caf71b8fec10dc8c6.tar.bz2 |
Create only one section symbol per section.
Unfortunately some consumers of our .o files produced with -r expect
only one section symbol per section. That is true of at least of go's
own linker.
Combining them is a somewhat convoluted process. We have to create a
symbol for every section since we don't know which ones will be
needed. The relocation sections also have to be written first to
handle the Elf_Rel addend.
I did consider a completely different approach:
We could remove the -r special case of relocation sections when
reading. We would instead have a copyRelocs function that is used
instead of scanRelocs. It would create a DynamicReloc for each
relocation and a RelocationSection for each input relocation section.
A complication of such change is that DynamicReloc would have to take
a section index and a input section instead of a symbol since with
-emit-relocs some DynamicReloc would hold relocations referring to the
dynamic symbol table and other to the static symbol table.
That would be a pretty big change, and if we do it it is probably
better to do it as a refactoring.
llvm-svn: 294816
Diffstat (limited to 'llvm/lib/Bitcode/Reader/BitcodeReader.cpp')
0 files changed, 0 insertions, 0 deletions