Patchwork aarch64: Use PTR_REG macro to fix ILP32 bug and make code consistent

login
register
mail settings
Submitter Steve Ellcey
Date Aug. 22, 2017, 5:27 p.m.
Message ID <1503422868.28672.28.camel@cavium.com>
Download mbox | patch
Permalink /patch/22312/
State New
Headers show

Comments

Steve Ellcey - Aug. 22, 2017, 5:27 p.m.
This patch is a one line change to use the PTR_REG macro in a cmp instruction
in dl-tlsdesc.S.  It only causes a problem in ILP32 mode but I would like
to submit it and check it in now so that the source code is consistent in
its use of PTR_REG.  Tested in ILP32 and LP64 modes on aarch64.

I think this counts as an 'obvious' fix, so I will check it in later today
if there are no objections.

Steve Ellcey
sellcey@cavium.com


2017-08-22  Szabolcs Nagy  <szabolcs.nagy@arm.com>
            Steve Ellcey  <sellcey@caviumnetworks.com>

        * sysdeps/aarch64/dl-tlsdesc.S (_dl_tlsdesc_dynamic):
        Use PTR_REG macro in cmp instruction.

Patch

diff --git a/sysdeps/aarch64/dl-tlsdesc.S b/sysdeps/aarch64/dl-tlsdesc.S
index a70cfd5..3b2da62 100644
--- a/sysdeps/aarch64/dl-tlsdesc.S
+++ b/sysdeps/aarch64/dl-tlsdesc.S
@@ -208,7 +208,7 @@  _dl_tlsdesc_dynamic:
 	ldr	PTR_REG (2), [x1,#TLSDESC_MODID]
 	add	PTR_REG (0), PTR_REG (0), PTR_REG (2), lsl #(PTR_LOG_SIZE + 1)
 	ldr	PTR_REG (0), [x0] /* Load val member of DTV entry.  */
-	cmp	x0, #TLS_DTV_UNALLOCATED
+	cmp	PTR_REG (0), #TLS_DTV_UNALLOCATED
 	b.eq	2f
 	ldr	PTR_REG (1), [x1,#TLSDESC_MODOFF]
 	add	PTR_REG (0), PTR_REG (0), PTR_REG (1)