bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug binutils/17415] New: Overflow in relocation (R_AARCH64_TLSLE_ADD_TP


From: shenhan at google dot com
Subject: [Bug binutils/17415] New: Overflow in relocation (R_AARCH64_TLSLE_ADD_TPREL_HI12) silently ignored
Date: Fri, 19 Sep 2014 17:31:28 +0000

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

            Bug ID: 17415
           Summary: Overflow in relocation
                    (R_AARCH64_TLSLE_ADD_TPREL_HI12) silently ignored
           Product: binutils
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: binutils
          Assignee: unassigned at sourceware dot org
          Reporter: shenhan at google dot com

Created attachment 7795
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7795&action=edit
test case

Hi while developing gold for aarch64, we found a case (attached) that overflows
relocation R_AARCH64_TLSLE_ADD_TPREL_HI12, because the offset from TP (thread
pointer) is too large (bigger than 2^24). Instead of generating an error, the
bfd aarch64 linker silently truncates the higher bits of offset, leading to a
run time error.

To reproduce, just compile - 
gcc -O0 case.c
./a.out
The exit value is 7, but the correct value should be 0.

The relocations to compute tp-offset of "i" is at 400600 and 400604, which is
apparently not "10".
  .... ....
  4005fc:       d53bd040        mrs     x0, tpidr_el0
  400600:       91400000        add     x0, x0, #0x0, lsl #12
  400604:       91004000        add     x0, x0, #0x10
  400608:       b9400000        ldr     w0, [x0]
  40060c:       910043ff        add     sp, sp, #0x10
  400610:       d65f03c0        ret
  .... ....

This was observed on trunk as well as 2.24.

-- 
You are receiving this mail because:
You are on the CC list for the bug.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]