[PATCH] D72056: [RISCV] Generate PIC address sequence for medany -fno-pic

2020-01-01 Thread James Clarke via Phabricator via cfe-commits
jrtc27 added inline comments. Comment at: llvm/lib/Target/TargetMachine.cpp:192 return false; +// RISC-V non-small code models prefer avoiding copy relocations. +if (TT.isRISCV() && getCodeModel() != CodeModel::Small) MaskRay wrote: > jrtc27 wrote:

[PATCH] D72056: [RISCV] Generate PIC address sequence for medany -fno-pic

2020-01-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay marked 2 inline comments as done. MaskRay added a subscriber: bsdjhb. MaskRay added inline comments. Comment at: llvm/lib/Target/RISCV/RISCVExpandPseudoInsts.cpp:680 + if (MF->getTarget().isPositionIndependent() || + MF->getTarget().getCodeModel() != CodeModel::Smal

[PATCH] D72056: [RISCV] Generate PIC address sequence for medany -fno-pic

2020-01-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay added a comment. In D72056#1800524 , @jrtc27 wrote: > I am still of the view that we should support rewriting the instruction > stream in the linker when necessary like BFD does. We need to do this to be > able to link in GCC-compiled code, inclu

[PATCH] D72056: [RISCV] Generate PIC address sequence for medany -fno-pic

2020-01-01 Thread James Clarke via Phabricator via cfe-commits
jrtc27 added a comment. I am still of the view that we should support rewriting the instruction stream in the linker when necessary like BFD does. We need to do this to be able to link in GCC-compiled code, including libraries. It is a very simple thing to do with a patch available that provide

[PATCH] D72056: [RISCV] Generate PIC address sequence for medany -fno-pic

2020-01-01 Thread Fangrui Song via Phabricator via cfe-commits
MaskRay created this revision. Herald added subscribers: llvm-commits, cfe-commits, luismarques, apazos, sameer.abuasal, pzheng, s.egerton, lenary, Jim, benna, psnobl, jocewei, PkmX, rkruppe, the_o, brucehoult, MartinMosbeck, rogfer01, edward-jones, zzheng, jrtc27, shiva0217, kito-cheng, niosHD,