https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=9c1937eb7103bee8c329b9c4f5137fcd1726b23d
commit 9c1937eb7103bee8c329b9c4f5137fcd1726b23d
Author: Guillaume Vacheria <guillaume.vacherias@foss.st.com>
Date: Tue Sep 1 11:41:06 2026 +0100
Add missing files for the test of objdump's --map-global-vars option.
Resolves BZ 34577
Diff:
---
.../binutils-all/objdump-map-global-vars.c | 48 ++++++++++++
.../testsuite/binutils-all/objdump.map-global-vars | 87 ++++++++++++++++++++++
2 files changed, 135 insertions(+)
diff --git a/binutils/testsuite/binutils-all/objdump-map-global-vars.c b/binutils/testsuite/binutils-all/objdump-map-global-vars.c
new file mode 100644
index 00000000000..4ae0d3b007c
--- /dev/null
+++ b/binutils/testsuite/binutils-all/objdump-map-global-vars.c
@@ -0,0 +1,48 @@
+char a;
+int b;
+long c;
+void *d;
+
+volatile int e;
+const int f;
+
+enum _enum {
+ E1,
+ E2,
+ E3
+};
+
+enum _enum g;
+
+struct _struct {
+ char m1;
+ enum _enum m2;
+};
+
+struct _struct h;
+
+union _union {
+ char u1;
+ const char *u2;
+};
+
+union _union i;
+
+struct _node {
+ int value;
+ struct _node *next;
+};
+
+typedef struct _node node;
+
+node j;
+
+node k[4][2];
+
+char *l[2];
+
+int
+main (void)
+{
+ return 0;
+}
diff --git a/binutils/testsuite/binutils-all/objdump.map-global-vars b/binutils/testsuite/binutils-all/objdump.map-global-vars
new file mode 100644
index 00000000000..cb37930ce1c
--- /dev/null
+++ b/binutils/testsuite/binutils-all/objdump.map-global-vars
@@ -0,0 +1,87 @@
+.*objdump-map-global-vars: file format .*
+
+a @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: char, size: 0x1
+
+b @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: int, size: 0x(2|4|8)
+
+c @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: long .*, size: 0x(4|8)
+
+d @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: ptr, size: 0x(4|8)
+
+e @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: volatile
+ type: int, size: 0x(2|4|8)
+
+f @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: const
+ type: int, size: 0x(2|4|8)
+
+g @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: enum _enum, size: 0x(2|4)
+ {
+ value: E1 = 0
+ value: E2 = 1
+ value: E3 = 2
+ }
+
+h @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: struct _struct, size: 0x(4|8)
+ {
+ member: m1, offset: 0
+ type: char, size: 0x1
+ member: m2, offset: 0x(4|8)
+ type: enum _enum, size: 0x(2|4)
+ {
+ value: E1 = 0
+ value: E2 = 1
+ value: E3 = 2
+ }
+ }
+
+i @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: union _union, size: 0x(2|4|8)
+ {
+ member: u1, offset: 0
+ type: char, size: 0x1
+ member: u2, offset: 0
+ type: ptr, size: 0x(2|4|8)
+ type: const
+ type: char, size: 0x1
+ }
+
+j @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: typedef node
+ {
+ type: struct _node, size: 0x(4|8|10)
+ {
+ member: value, offset: 0
+ type: int, size: 0x(2|4|8)
+ member: next, offset: 0x(4|8)
+ type: ptr, size: 0x(2|4|8)
+ nested: struct _node
+ }
+ }
+
+k @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: array\[4\]\[2\]
+ type: typedef node
+ {
+ type: struct _node, size: 0x(4|8|10)
+ {
+ member: value, offset: 0
+ type: int, size: 0x(2|4|8)
+ member: next, offset: 0x8
+ type: ptr, size: 0x(2|4|8)
+ nested: struct _node
+ }
+ }
+
+l @ 0x([0-9a-fA-F]{8}) 0x([0-9a-fA-F]{8})
+ type: array\[2\]
+ type: ptr, size: 0x(2|4|8)
+ type: char, size: 0x1
+