public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* Fix ld/12928 -- alpha tlsldm relaxation error
@ 2011-06-24 17:45 Richard Henderson
  0 siblings, 0 replies; only message in thread
From: Richard Henderson @ 2011-06-24 17:45 UTC (permalink / raw)
  To: binutils; +Cc: Uros Bizjak

[-- Attachment #1: Type: text/plain, Size: 443 bytes --]

This was a bug in the fix for

2010-08-09  Richard Henderson  <rth@redhat.com>

        PR ld/11891
        * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Disallow relaxing
        to tlshi/lo until pos0 and pos1 are adjacent.  Use the destination
        register from the tldgd insn.

in which I pulled out the register from the tlsgd insn
after pos0 and pos1 had been swapped.  So we pulled the
register from the wrong instruction.


r~

[-- Attachment #2: z --]
[-- Type: text/plain, Size: 1780 bytes --]

        PR ld/12928
        * elf64-alpha.c (elf64_alpha_relax_tls_get_addr): Recover the
        tlsgd insn before swapping adjacent insns.



Index: elf64-alpha.c
===================================================================
RCS file: /cvs/src/src/bfd/elf64-alpha.c,v
retrieving revision 1.179
diff -u -p -r1.179 elf64-alpha.c
--- elf64-alpha.c	22 Jun 2011 16:18:24 -0000	1.179
+++ elf64-alpha.c	24 Jun 2011 17:29:38 -0000
@@ -3508,6 +3508,13 @@ elf64_alpha_relax_tls_get_addr (struct a
   pos[3] = info->contents + gpdisp->r_offset;
   pos[4] = pos[3] + gpdisp->r_addend;
 
+  /* Beware of the compiler hoisting part of the sequence out a loop
+     and adjusting the destination register for the TLSGD insn.  If this
+     happens, there will be a move into $16 before the JSR insn, so only
+     transformations of the first insn pair should use this register.  */
+  tlsgd_reg = bfd_get_32 (info->abfd, pos[0]);
+  tlsgd_reg = (tlsgd_reg >> 21) & 31;
+
   /* Generally, the positions are not allowed to be out of order, lest the
      modified insn sequence have different register lifetimes.  We can make
      an exception when pos 1 is adjacent to pos 0.  */
@@ -3575,13 +3582,6 @@ elf64_alpha_relax_tls_get_addr (struct a
   use_gottprel = FALSE;
   new_symndx = is_gd ? ELF64_R_SYM (irel->r_info) : STN_UNDEF;
 
-  /* Beware of the compiler hoisting part of the sequence out a loop
-     and adjusting the destination register for the TLSGD insn.  If this
-     happens, there will be a move into $16 before the JSR insn, so only
-     transformations of the first insn pair should use this register.  */
-  tlsgd_reg = bfd_get_32 (info->abfd, pos[0]);
-  tlsgd_reg = (tlsgd_reg >> 21) & 31;
-
   switch (!dynamic && !info->link_info->shared)
     {
     case 1:

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-06-24 17:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-06-24 17:45 Fix ld/12928 -- alpha tlsldm relaxation error Richard Henderson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).