Blame SOURCES/dyninst-11.0.0-aarch64.patch

e25486
rhbz1993578
e25486
e25486
commit 874a73ea4 (HEAD -> master, upstream/master)
e25486
Author: Stan Cox <scox@redhat.com>
e25486
Date:   Mon Nov 1 14:24:07 2021 -0400
e25486
e25486
    Don't overflow aarch64 float register vector when setting used regs. (#1127)
e25486
    
e25486
    Do not include the subtype when setting a float register as a used register if the registerSlot vector would be exceeded, e.g. for a value like 0x400 (Q_REG/register 0).
e25486
e25486
--- dyninst-11.0.0/dyninstAPI/src/inst-aarch64.C.orig
e25486
+++ dyninst-11.0.0/dyninstAPI/src/inst-aarch64.C
e25486
@@ -551,8 +551,13 @@ bool EmitterAARCH64::clobberAllFuncCall(registerSpace *rs,
e25486
             rs->GPRs()[*itr]->beenUsed = true;
e25486
 
e25486
         std::set<Register> *fpRegs = callee->ifunc()->usedFPRs();
e25486
-        for(std::set<Register>::iterator itr = fpRegs->begin(); itr != fpRegs->end(); itr++)
e25486
-            rs->FPRs()[*itr]->beenUsed = true;
e25486
+        for(std::set<Register>::iterator itr = fpRegs->begin(); itr != fpRegs->end(); itr++) {
e25486
+            if (*itr <= rs->FPRs().size())
e25486
+              rs->FPRs()[*itr]->beenUsed = true;
e25486
+            else
e25486
+              // parse_func::calcUsedRegs includes the subtype; we only want the regno
e25486
+              rs->FPRs()[*itr & 0xff]->beenUsed = true;
e25486
+        }
e25486
     } else {
e25486
         for(int idx = 0; idx < rs->numGPRs(); idx++)
e25486
             rs->GPRs()[idx]->beenUsed = true;
e25486
commit b2c892f55
e25486
Author: Stan Cox <scox@redhat.com>
e25486
Date:   Tue Oct 26 17:43:14 2021 -0400
e25486
e25486
    Load callee's address when the callee and caller are in the same module (#1056)
e25486
    
e25486
    If the callee and caller are in the same module and pic is not
e25486
    required then the callee's address can be loaded directly without
e25486
    using a relocation.
e25486
e25486
--- dyninst-11.0.0/dyninstAPI/src/inst-aarch64.C.orig
e25486
+++ dyninst-11.0.0/dyninstAPI/src/inst-aarch64.C
e25486
@@ -651,12 +651,14 @@ Register EmitterAARCH64::emitCall(opCode op,
e25486
 
e25486
     assert(gen.rs());
e25486
 
e25486
-    //Address of function to call in scratch register
e25486
+    // Address of function to call in scratch register
e25486
     Register scratch = gen.rs()->getScratchRegister(gen);
e25486
     assert(scratch != REG_NULL && "cannot get a scratch register");
e25486
     gen.markRegDefined(scratch);
e25486
 
e25486
-    if (gen.addrSpace()->edit() != NULL) {
e25486
+    if (gen.addrSpace()->edit() != NULL
e25486
+	&& (gen.func()->obj() != callee->obj()
e25486
+	    || gen.addrSpace()->needsPIC())) {
e25486
         // gen.as.edit() checks if we are in rewriter mode
e25486
         Address dest = getInterModuleFuncAddr(callee, gen);
e25486
 
e25486
@@ -666,7 +668,6 @@ Register EmitterAARCH64::emitCall(opCode op,
e25486
         instruction insn;
e25486
         insn.clear();
e25486
         INSN_SET(insn, 31, 31, 0);
e25486
-        //INSN_SET(insn, 29, 30, disp & 0x3);
e25486
         INSN_SET(insn, 28, 28, 1);
e25486
         INSN_SET(insn, 5, 23, disp >> 2);
e25486
         INSN_SET(insn, 0, 4, scratch);