public inbox for binutils@sourceware.org
 help / color / mirror / Atom feed
* [PATCH] RISC-V: PR29823, defined the missing elf_backend_obj_attrs_handle_unknown.
@ 2023-06-09  0:47 Nelson Chu
  0 siblings, 0 replies; only message in thread
From: Nelson Chu @ 2023-06-09  0:47 UTC (permalink / raw)
  To: binutils; +Cc: i, nelson

bfd/
	PR 29823
	* elfnn-riscv.c (riscv_elf_obj_attrs_handle_unknown): New function.
	(elf_backend_obj_attrs_handle_unknown): Defined to
	riscv_elf_obj_attrs_handle_unknown.
---
 bfd/elfnn-riscv.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/bfd/elfnn-riscv.c b/bfd/elfnn-riscv.c
index 30d2faa405d..5107ed3321e 100644
--- a/bfd/elfnn-riscv.c
+++ b/bfd/elfnn-riscv.c
@@ -4094,6 +4094,18 @@ _bfd_riscv_elf_merge_private_bfd_data (bfd *ibfd, struct bfd_link_info *info)
   return false;
 }
 
+/* Ignore and report warning for the unknwon elf attribute.  */
+
+static bool
+riscv_elf_obj_attrs_handle_unknown (bfd *abfd, int tag)
+{
+  _bfd_error_handler
+    /* xgettext:c-format */
+    (_("warning: %pB: unknown RISCV ABI object attribute %d"),
+     abfd, tag);
+  return true;
+}
+
 /* A second format for recording PC-relative hi relocations.  This stores the
    information required to relax them to GP-relative addresses.  */
 
@@ -5589,5 +5601,6 @@ riscv_elf_merge_symbol_attribute (struct elf_link_hash_entry *h,
 #define elf_backend_obj_attrs_section_type	SHT_RISCV_ATTRIBUTES
 #undef  elf_backend_obj_attrs_section
 #define elf_backend_obj_attrs_section		RISCV_ATTRIBUTES_SECTION_NAME
+#define elf_backend_obj_attrs_handle_unknown	riscv_elf_obj_attrs_handle_unknown
 
 #include "elfNN-target.h"
-- 
2.39.2 (Apple Git-143)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-06-09  0:47 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-09  0:47 [PATCH] RISC-V: PR29823, defined the missing elf_backend_obj_attrs_handle_unknown Nelson Chu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).