[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Bug ld/4928] New: Linker should check code sequence before TLS optimiza
From: |
hjl at lucon dot org |
Subject: |
[Bug ld/4928] New: Linker should check code sequence before TLS optimization |
Date: |
15 Aug 2007 21:35:27 -0000 |
X86/X86-64 linkers check code sequence while performing TLS optimization
like:
/* IE->LE transition:
Originally it can be one of:
movq address@hidden(%rip), %reg
addq address@hidden(%rip), %reg
We change it into:
movq $foo, %reg
leaq foo(%reg), %reg
addq $foo, %reg. */
BFD_ASSERT (rel->r_offset >= 3);
val = bfd_get_8 (input_bfd, contents + rel->r_offset - 3);
BFD_ASSERT (val == 0x48 || val == 0x4c);
type = bfd_get_8 (input_bfd, contents + rel->r_offset - 2);
BFD_ASSERT (type == 0x8b || type == 0x03);
reg = bfd_get_8 (input_bfd, contents + rel->r_offset - 1);
BFD_ASSERT ((reg & 0xc7) == 5);
reg >>= 3; BFD_ASSERT (rel->r_offset + 4 <=
input_section->size);
But not all TLS code sequences generated by all compilers follow the same
sequence. In many cases, such optimization is dangerous and wrong. We
should check the code sequence before performing such optimization.
--
Summary: Linker should check code sequence before TLS
optimization
Product: binutils
Version: 2.19 (HEAD)
Status: NEW
Severity: normal
Priority: P2
Component: ld
AssignedTo: unassigned at sources dot redhat dot com
ReportedBy: hjl at lucon dot org
CC: bug-binutils at gnu dot org,jakub at redhat dot com
http://sourceware.org/bugzilla/show_bug.cgi?id=4928
------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.
- [Bug ld/4928] New: Linker should check code sequence before TLS optimization,
hjl at lucon dot org <=