Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <43ab8c9c-6995-4525-af25-bd973445d60e@nbd.name>
Date: Tue, 6 May 2025 14:27:40 +0200
From: Felix Fietkau <nbd@....name>
To: musl@...ts.openwall.com,
 Ignacy Gawędzki <ignacy.gawedzki@...en-communications.fr>
Subject: Re: [PATCH 1/1] tools: Rework adding of CFI annotations.

Hi,

On 20.03.25 12:07, Ignacy Gawędzki wrote:
> Rework awk scripts used to add CFI annotations to i386 and x86_64
> assembly, in order to properly maintain CFA offset across in-function
> jumps.
> 
> Add arm and aarch64 versions of these scripts.
> 
> Signed-off-by: Ignacy Gawędzki <ignacy.gawedzki@...en-communications.fr>

I've tested your patch. It works for me on aarch64, however it broke on 
x86_64 when compiling tlsdesc.s. It seems that the whitespace 
canonicalization inserted extra whitespace in this line:
     mov %fs:8,%rdx

That broke the match in get_reg2, which refers to $2

With the following extra change on top, it works for me.

Thanks,

- Felix


---
--- a/tools/add-cfi.x86_64.awk
+++ b/tools/add-cfi.x86_64.awk
@@ -79,7 +79,8 @@ function jump_to_label(label) {
    # Canonicalize whitespace.
    gsub(/[ \t]+/, " ") # Mawk doesn't understand \s.
    gsub(/ *, */, ",")
-  gsub(/ *: */, ": ")
+  if (match(":", $1))
+    sub(/ *: */, ": ")
    gsub(/ $/, "")
    gsub(/^ /, "")
  }


Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.