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)
commitad04f5db82d5433f9f5e134a9610f88ba1cdf810
tree51d2d12e712b75bac8b4ea5301fbf7f8baa213b7
parent1338612c555a6a2f73deacd99b97643d2759c246
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.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@219829 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCContext.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MCContext.cpp
lib/MC/MCELFStreamer.cpp
test/MC/ELF/comdat.s
test/MC/ELF/section-sym-err.s [new file with mode: 0644]
test/MC/ELF/section-sym.s [new file with mode: 0644]
tools/llvm-readobj/ELFDumper.cpp