Be consistent when deciding if a relocation is needed.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Apr 2015 15:27:57 +0000 (15:27 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 6 Apr 2015 15:27:57 +0000 (15:27 +0000)
commit9428f184be2492c6bae7d361bc3f44437641dc50
tree10c452ca87dcae38e7a7127ef0a73515c2ac553c
parent6dc9f59df9dd879f72975fe238cbffafe8e8c891
Be consistent when deciding if a relocation is needed.

Before when deciding if we needed a relocation in A-B, we wore only checking
if A was weak.

This fixes the asymmetry.

The "InSet" argument should probably be renamed to "ForValue", since InSet is
very MachO specific, but doing so in this patch would make it hard to read.

This fixes PR22815.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@234165 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/MC/MCMachObjectWriter.h
include/llvm/MC/MCObjectWriter.h
lib/MC/ELFObjectWriter.cpp
lib/MC/MCAssembler.cpp
lib/MC/MCObjectWriter.cpp
lib/MC/MachObjectWriter.cpp
lib/MC/WinCOFFObjectWriter.cpp
test/MC/ELF/weak-diff2.s [new file with mode: 0644]