https://sourceware.org/bugzilla/show_bug.cgi?id=19977

            Bug ID: 19977
           Summary: [mips] gas writes incorrect addendum for %tprel_hi
                    relocation
           Product: binutils
           Version: 2.27 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: simon at atanasyan dot com
  Target Milestone: ---

gas does not extract "hi" value from the %tprel_hi relocation's arguments and
writes the addendum as is. That makes impossible to use addends greater than
0xffff.

% cat tprel.s
  .text
foo:
  lui     $3,%tprel_hi($loc0+0x7ffc)
  addiu   $3,$3,%tprel_lo($loc0+0x7ffc)

  .section .tdata,"awT",%progbits
$loc0:
  .word 0

% as -EB -mips32 -mabi=32 tprel.s
% objdump -dr a.out
...
00000000 <foo>:
   0:   3c037ffc        lui     v1,0x7ffc
                        0: R_MIPS_TLS_TPREL_HI16        $loc0
   4:   24637ffc        addiu   v1,v1,32764
                        4: R_MIPS_TLS_TPREL_LO16        $loc0

-- 
You are receiving this mail because:
You are on the CC list for the bug.
_______________________________________________
bug-binutils mailing list
bug-binutils@gnu.org
https://lists.gnu.org/mailman/listinfo/bug-binutils

Reply via email to