Correctly handle references to section symbols.
authorRafael Espindola <rafael.espindola@gmail.com>
Wed, 15 Oct 2014 18:55:30 +0000 (18:55 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Wed, 15 Oct 2014 18:55:30 +0000 (18:55 +0000)
commita74b5e682361e336f56cc3fdbeb05c8183c089e1
tree11e01d2e892ddc6be7638d29e6d4cf28da48edfa
parentb0c5b8f22879ad8445962d60b3d479b10b4d9d56
Correctly handle references to section symbols.

When processing assembly like

.long .text

we were creating a new undefined symbol .text. GAS on the other hand would
handle that as a reference to the .text section.

This patch implements that by creating the section symbols earlier so that
they are visible during asm parsing.

The patch also updates llvm-readobj to print the symbol number in the relocation
dump so that the test can differentiate between two sections with the same name.

llvm-svn: 219829
llvm/include/llvm/MC/MCContext.h
llvm/lib/MC/ELFObjectWriter.cpp
llvm/lib/MC/MCContext.cpp
llvm/lib/MC/MCELFStreamer.cpp
llvm/test/MC/ELF/comdat.s
llvm/test/MC/ELF/section-sym-err.s [new file with mode: 0644]
llvm/test/MC/ELF/section-sym.s [new file with mode: 0644]
llvm/tools/llvm-readobj/ELFDumper.cpp