[PATCH] gas: Make sure to only add an md5 to a .file when requested.
Mark Wielaard
mark@klomp.org
Sat Aug 29 00:35:24 GMT 2020
In dwarf2_directive_filename with_md5 is always TRUE. But since if no
md5 is actually given generic_bignum is normally all zeros. Which still
means no md5. But if gas has just parsed a bignum that value will be used
as md5 value. Fix that by initializing with_md5 to FALSE, so that it is
only true when the file directive contains an md5 string.
Add a random bignum value to the dwarf-5-file0.s testcase so that it
fails before this path, but succeeds after.
* dwarf2dbg.c (dwarf2_directive_filename): Initialize with_md5 to
FALSE.
* gas/testsuite/gas/elf/dwarf-5-file0.s: Add a random bignum.
---
gas/ChangeLog | 6 ++++++
gas/dwarf2dbg.c | 2 +-
gas/testsuite/gas/elf/dwarf-5-file0.s | 2 ++
3 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 9bdbb4b172f..452bb03a105 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,3 +1,9 @@
+2020-08-28 Mark Wielaard <mark@klomp.org>
+
+ * dwarf2dbg.c (dwarf2_directive_filename): Initialize with_md5 to
+ FALSE.
+ * gas/testsuite/gas/elf/dwarf-5-file0.s: Add a random bignum.
+
2020-08-28 Alan Modra <amodra@gmail.com>
PR 26460
diff --git a/gas/dwarf2dbg.c b/gas/dwarf2dbg.c
index e4ba56d82ba..8a840d0cbf1 100644
--- a/gas/dwarf2dbg.c
+++ b/gas/dwarf2dbg.c
@@ -1014,7 +1014,7 @@ dwarf2_emit_label (symbolS *label)
char *
dwarf2_directive_filename (void)
{
- bfd_boolean with_md5 = TRUE;
+ bfd_boolean with_md5 = FALSE;
valueT num;
char *filename;
const char * dirname = NULL;
diff --git a/gas/testsuite/gas/elf/dwarf-5-file0.s b/gas/testsuite/gas/elf/dwarf-5-file0.s
index 2792ba8c441..9fc07b5441c 100644
--- a/gas/testsuite/gas/elf/dwarf-5-file0.s
+++ b/gas/testsuite/gas/elf/dwarf-5-file0.s
@@ -10,6 +10,8 @@
.text
.word 0
+ .octa 0x12345678901234567890123456789012
+
.file 1 "secondary directory/secondary source file"
.line 2
.word 2
--
2.18.4
More information about the Binutils
mailing list