File: pr33991.diff

package info (click to toggle)
elfutils 0.194-4
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 28,848 kB
  • sloc: ansic: 115,014; sh: 35,537; cpp: 4,998; makefile: 1,986; yacc: 1,388; lex: 130; asm: 77; sed: 39; awk: 35
file content (63 lines) | stat: -rw-r--r-- 1,919 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
From b27adc5262e807f341ca0a4910ce04294144f79a Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 24 Feb 2026 22:19:48 +0100
Subject: aarch64: Recognize SHT_AARCH64_ATTRIBUTES

Recognize SHT_AARCH64_ATTRIBUTES. This is enough to stop elflint
complaining about unknown section types. But doesn't implement parsing
the attributes.

	* backends/aarch64_symbol.c (aarch64_section_type_name):
 	New function.
	* backends/aarch64_init.c (aarch64_init): Hook
        section_type_name.

https://sourceware.org/bugzilla/show_bug.cgi?id=33923

Signed-off-by: Mark Wielaard <mark@klomp.org>
---
 backends/aarch64_init.c   |  1 +
 backends/aarch64_symbol.c | 18 ++++++++++++++++++
 2 files changed, 19 insertions(+)

diff --git a/backends/aarch64_init.c b/backends/aarch64_init.c
index bed92954..c61767d5 100644
--- a/backends/aarch64_init.c
+++ b/backends/aarch64_init.c
@@ -54,6 +54,7 @@ aarch64_init (Elf *elf __attribute__ ((unused)),
   HOOK (eh, dynamic_tag_check);
   HOOK (eh, data_marker_symbol);
   HOOK (eh, abi_cfi);
+  HOOK (eh, section_type_name);
 
   /* X0-X30 (31 regs) + SP + 1 Reserved + ELR, 30 Reserved regs (34-43)
      + V0-V31 (32 regs, least significant 64 bits only)
diff --git a/backends/aarch64_symbol.c b/backends/aarch64_symbol.c
index 15e0805b..af9322fd 100644
--- a/backends/aarch64_symbol.c
+++ b/backends/aarch64_symbol.c
@@ -134,3 +134,21 @@ aarch64_dynamic_tag_check (int64_t tag)
 	  || tag == DT_AARCH64_PAC_PLT
 	  || tag == DT_AARCH64_VARIANT_PCS);
 }
+
+/* Return symbolic representation of section type.  */
+const char *
+aarch64_section_type_name (int type,
+			   char *buf __attribute__ ((unused)),
+			   size_t len __attribute__ ((unused)))
+{
+  switch (type)
+    {
+#ifndef SHT_AARCH64_ATTRIBUTES
+#define SHT_AARCH64_ATTRIBUTES 0x70000003
+#endif
+    case SHT_AARCH64_ATTRIBUTES:
+      return "AARCH64_ATTRIBUTES";
+    }
+
+  return NULL;
+}
-- 
cgit