bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/16340] New: aarch64: offset into GOT for TLS relocation computed


From: michael.hudson at linaro dot org
Subject: [Bug ld/16340] New: aarch64: offset into GOT for TLS relocation computed inconsistently
Date: Wed, 18 Dec 2013 03:26:54 +0000

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

            Bug ID: 16340
           Summary: aarch64: offset into GOT for TLS relocation computed
                    inconsistently
           Product: binutils
           Version: 2.25 (HEAD)
            Status: NEW
          Severity: normal
          Priority: P2
         Component: ld
          Assignee: unassigned at sourceware dot org
          Reporter: michael.hudson at linaro dot org

Created attachment 7328
  --> https://sourceware.org/bugzilla/attachment.cgi?id=7328&action=edit
simple proposed fix

Hi,

I don't have a non-gigantic test case but it's possible for the offset into the
GOT used when accessing a __thread variable to be different from that written
into the relocation (modulo confusions with terminology :).

This is the code that determines the offset to patch into the code
(elfnn-aarch64.c line 3845):

                   value = (symbol_got_offset (input_bfd, h, r_symndx)
                            + globals->root.sgot->output_section->vma
                            +
globals->root.sgot->output_section->output_offset);

and this is the code that determines the offset as written into the relocation
(elfnn-aarch64.c line 4248):

                           off = symbol_got_offset (input_bfd, h, r_symndx);
                           ...
                               rela.r_offset =
globals->root.sgot->output_section->vma +
                                 globals->root.sgot->output_offset + off;

The former is "root.sgot->output_section->output_offset", the latter is
"root.sgot->output_offset".

I'll attach a very simple patch that seems to fix the problem.  A test case
would be nice, but is beyond my knowledge currently.

-- 
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]