[nasm:nasm-2.15.xx] BR 3392657: dwarf: leave .debug_frame empty

nasm-bot for H. Peter Anvin (Intel) hpa at zytor.com
Sun Jun 14 23:21:03 PDT 2020


Commit-ID:  a6ea1152bc571a6622c59ad4025567361d61773d
Gitweb:     http://repo.or.cz/w/nasm.git?a=commitdiff;h=a6ea1152bc571a6622c59ad4025567361d61773d
Author:     H. Peter Anvin (Intel) <hpa at zytor.com>
AuthorDate: Sun, 14 Jun 2020 23:16:50 -0700
Committer:  H. Peter Anvin (Intel) <hpa at zytor.com>
CommitDate: Sun, 14 Jun 2020 23:16:50 -0700

BR 3392657: dwarf: leave .debug_frame empty

Until such time that we have a CFI code generator, leave .debug_frame
empty.

Reported-by: Philip Craig <philipjcraig at gmail.com>
Signed-off-by: H. Peter Anvin (Intel) <hpa at zytor.com>


---
 output/outelf.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/output/outelf.c b/output/outelf.c
index 18b52d88..8af0f120 100644
--- a/output/outelf.c
+++ b/output/outelf.c
@@ -3439,9 +3439,14 @@ static void dwarf_generate(void)
     saa_free(plinesrel);
 
     /* build frame section */
-    framelen = 4;
-    framebuf = pbuf = nasm_malloc(framelen);
-    WRITELONG(pbuf,framelen-4); /* initial length */
+    if (0) {
+        /* This only applies if there is at least one frame defined */
+        framelen = 4;
+        framebuf = pbuf = nasm_malloc(framelen);
+        WRITELONG(pbuf,framelen-4); /* initial length */
+    } else {
+        framelen = 0;
+    }
 
     /* build loc section */
     loclen = 16;


More information about the Nasm-commits mailing list