From 4e65501f13a7ab04b6f1fd693fc4c66e1e9cd41c Mon Sep 17 00:00:00 2001 From: Andrew Turner Date: Thu, 13 Apr 2017 15:43:44 +0000 Subject: [PATCH] Don't prefix zero with 0x in assym.s. The arm64 binutils only accepts 0 as an offset to the Load-Acquire Register instructions where llvm will acceps both 0 and 0x0. The thread switching code uses these with SCHED_ULE to block waiting for a lock to be released. As the offset of the data to be loaded is zero this is safe, however it is useful to keep the offset in the instruction to document what is being loaded. To work around this issue in binutils only generate the 0x prefix for non-zero values. Reported by: kan Sponsored by: DARPA, AFRL --- sys/kern/genassym.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/sys/kern/genassym.sh b/sys/kern/genassym.sh index 521c7a20805..0374c8844b9 100644 --- a/sys/kern/genassym.sh +++ b/sys/kern/genassym.sh @@ -32,12 +32,15 @@ work() sub("^0*", "", w) if (w == "") w = "0" + hex = "" + if (w != "0") + hex = "0x" sub("w3$", "", $3) # This still has minor problems representing INT_MIN, etc. # E.g., # with 32-bit 2''s complement ints, this prints -0x80000000, # which has the wrong type (unsigned int). - printf("#define\t%s\t%s0x%s\n", $3, sign, w) + printf("#define\t%s\t%s%s%s\n", $3, sign, hex, w) } ' }