Fix two issues regarding Got pointer (GP) setup.
authorReed Kotler <rkotler@mips.com>
Wed, 18 Sep 2013 22:46:09 +0000 (22:46 +0000)
committerReed Kotler <rkotler@mips.com>
Wed, 18 Sep 2013 22:46:09 +0000 (22:46 +0000)
commitc1fe3e3b330d9404530abc2fbbd0f6d1fa64ce01
treedd85d4f36bd5be84fa2ac0e8453069f3841bacc2
parent0a4371a2073d8841768cf3e8cf65601a8d7cc4fc
Fix two issues regarding Got pointer (GP) setup.
1) make sure that the first two instructions of the sequence cannot
separate from each other. The linker requires that they be sequential.
If they get separated, it can still work but it will not work in all
cases because the first of the instructions mostly involves the hi part
of the pc relative offset and that part changes slowly. You would have
to be at the right boundary for this to matter.
2) make sure that this sequence begins  on a longword boundary.
There appears to be a bug in binutils which makes some of these calculations
get messed up if the instruction sequence does not begin on a longword
boundary. This is being investigated with the appropriate binutils folks.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@190966 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Target/Mips/Mips16ISelDAGToDAG.cpp
lib/Target/Mips/Mips16InstrInfo.td
test/CodeGen/Mips/helloworld.ll