This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
[PATCH] aarch64: Use PTR_REG macro to fix ILP32 bug and make code consistent
- From: Steve Ellcey <sellcey at cavium dot com>
- To: libc-alpha <libc-alpha at sourceware dot org>
- Cc: Szabolcs Nagy <szabolcs dot nagy at arm dot com>
- Date: Tue, 22 Aug 2017 10:27:48 -0700
- Subject: [PATCH] aarch64: Use PTR_REG macro to fix ILP32 bug and make code consistent
- Authentication-results: sourceware.org; auth=none
- Authentication-results: spf=none (sender IP is ) smtp.mailfrom=Steve dot Ellcey at cavium dot com;
- Reply-to: sellcey at cavium dot com
- Spamdiagnosticmetadata: NSPM
- Spamdiagnosticoutput: 1:99
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.
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)