diff options
author | Rafael Espindola <rafael.espindola@gmail.com> | 2017-06-22 21:57:04 +0000 |
---|---|---|
committer | Rafael Espindola <rafael.espindola@gmail.com> | 2017-06-22 21:57:04 +0000 |
commit | d2edd137dfbfbd6e0db3ed17f806c99530cadcf1 (patch) | |
tree | b88743e165ac36d900dba676a28d68197ed5039d /llvm/lib/MC/WinCOFFObjectWriter.cpp | |
parent | 3cd8bb30f05757cda5408d0426e3c59a113c205b (diff) | |
download | bcm5719-llvm-d2edd137dfbfbd6e0db3ed17f806c99530cadcf1.tar.gz bcm5719-llvm-d2edd137dfbfbd6e0db3ed17f806c99530cadcf1.zip |
Change creation of relative relocations on COFF.
For whatever reason, when processing
.globl foo
foo:
.data
bar:
.long foo-bar
llvm-mc creates a relocation with the section:
0x0 IMAGE_REL_I386_REL32 .text
This is different than when the relocation is relative from the
beginning. For example, a file with
call foo
produces
0x0 IMAGE_REL_I386_REL32 foo
I would like to refactor the logic for converting "foo - ." into a
relative relocation so that it is shared with ELF. This is the first
step and just changes the coff implementation to match what ELF (and
COFF in the case of calls) does.
llvm-svn: 306063
Diffstat (limited to 'llvm/lib/MC/WinCOFFObjectWriter.cpp')
-rw-r--r-- | llvm/lib/MC/WinCOFFObjectWriter.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/MC/WinCOFFObjectWriter.cpp b/llvm/lib/MC/WinCOFFObjectWriter.cpp index ec1fa0801a0..08b349c7c68 100644 --- a/llvm/lib/MC/WinCOFFObjectWriter.cpp +++ b/llvm/lib/MC/WinCOFFObjectWriter.cpp @@ -775,7 +775,7 @@ void WinCOFFObjectWriter::recordRelocation( Reloc.Data.VirtualAddress = Layout.getFragmentOffset(Fragment); // Turn relocations for temporary symbols into section relocations. - if (A.isTemporary() || SymB) { + if (A.isTemporary()) { MCSection *TargetSection = &A.getSection(); assert( SectionMap.find(TargetSection) != SectionMap.end() && |