Re: Fix offset for ia64 PCREL60B relocation on HP-UX
authorAlan Modra <amodra@gmail.com>
Sat, 22 May 2021 03:29:36 +0000 (12:59 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 22 May 2021 07:53:24 +0000 (17:23 +0930)
PR 25599
* config/tc-ia64.c (emit_one_bundle): Expand comment for HP-UX
adjustment.  Add assertion.
* testsuite/gas/ia64/reloc-mlx.d: Pass when slot 2 specified
for PCREL60B.

gas/ChangeLog
gas/config/tc-ia64.c
gas/testsuite/gas/ia64/reloc-mlx.d

index b9a59b66b808d27e499331882310fe4670a77a95..cf135d98d518c25cc44a8409a3caccf063f5f912 100644 (file)
@@ -1,3 +1,11 @@
+2021-05-22  Alan Modra  <amodra@gmail.com>
+
+       PR 25599
+       * config/tc-ia64.c (emit_one_bundle): Expand comment for HP-UX
+       adjustment.  Add assertion.
+       * testsuite/gas/ia64/reloc-mlx.d: Pass when slot 2 specified
+       for PCREL60B.
+
 2021-05-20  Sergey Belyashov  <sergey.belyashov@gmail.com>
 
        * config/tc-z80.c (emit_data_val): Warn on constant overflow.
index 34482eb4f973963adb6b4d9587642c112df42bf3..dd2147b5176a8ba269ea1a21389c1490bf3dcd78 100644 (file)
@@ -6892,9 +6892,15 @@ emit_one_bundle (void)
          ifix = md.slot[curr].fixup + j;
          where = frag_now_fix () - 16 + i;
 #ifdef TE_HPUX
-         /* Fix offset for PCREL60B relocation on HP-UX.  */
+         /* Relocations for instructions specify the slot in the
+            bottom two bits of r_offset.  The IA64 HP-UX linker
+            expects PCREL60B relocations to specify slot 2 of an
+            instruction.  gas generates PCREL60B against slot 1.  */
          if (ifix->code == BFD_RELOC_IA64_PCREL60B)
-           ++where;
+           {
+             know (i == 1);
+             ++where;
+           }
 #endif
 
          fix = fix_new_exp (frag_now, where, 8,
index cd210f6f00574e85edeecf61b8908af51b3bb238..1583872481da9e4a973a5cfbc4ee6b04e9ee65c8 100644 (file)
@@ -5,4 +5,4 @@
 
 RELOCATION RECORDS FOR \[\.text\]:
 OFFSET[[:space:]]+TYPE[[:space:]]+VALUE[[:space:]]*
-0+1[[:space:]]+PCREL60B[[:space:]]+bar
+0+[12][[:space:]]+PCREL60B[[:space:]]+bar