public inbox for binutils-cvs@sourceware.org
 help / color / mirror / Atom feed
* [binutils-gdb] kvx: fix handling of STB_GNU_UNIQUE symbols
@ 2023-08-24  3:07 Alan Modra
  0 siblings, 0 replies; only message in thread
From: Alan Modra @ 2023-08-24  3:07 UTC (permalink / raw)
  To: bfd-cvs

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=66644c5dc3d61b5cabefba7f0ddb467c2ca750ed

commit 66644c5dc3d61b5cabefba7f0ddb467c2ca750ed
Author: Paul Iannetta <piannetta@kalrayinc.com>
Date:   Wed Aug 23 16:39:21 2023 +0200

    kvx: fix handling of STB_GNU_UNIQUE symbols
    
    When processing a STB_GNU_UNIQUE symbol we did not update has_gnu_osabi
    correctly.
    
            * config/tc-kvx.c (kvx_end): Do not write to e_ident.
            (kvx_type): Properly handle STB_GNU_UNIQUE symbols.

Diff:
---
 gas/config/tc-kvx.c | 10 ++++------
 1 file changed, 4 insertions(+), 6 deletions(-)

diff --git a/gas/config/tc-kvx.c b/gas/config/tc-kvx.c
index c5c8312922f..be8bc7da923 100644
--- a/gas/config/tc-kvx.c
+++ b/gas/config/tc-kvx.c
@@ -2205,7 +2205,6 @@ void
 kvx_end (void)
 {
   int newflags;
-  Elf_Internal_Ehdr *i_ehdrp;
 
   if (!env.params.core_set)
     env.params.core = kvx_core_info->elf_core;
@@ -2218,10 +2217,6 @@ kvx_end (void)
 
   bfd_set_private_flags (stdoutput, newflags);
 
-  i_ehdrp = elf_elfheader (stdoutput);
-  i_ehdrp->e_ident[EI_ABIVERSION] = env.params.abi;
-  i_ehdrp->e_ident[EI_OSABI] = env.params.osabi;
-
   cleanup ();
 
   if (inside_bundle && insncnt != 0)
@@ -2277,7 +2272,10 @@ kvx_type (int start ATTRIBUTE_UNUSED)
     type = BSF_ELF_COMMON;
   else if (strcmp (typename, "gnu_unique_object") == 0
 	   || strcmp (typename, "STB_GNU_UNIQUE") == 0)
-    type = BSF_OBJECT | BSF_GNU_UNIQUE;
+    {
+      elf_tdata (stdoutput)->has_gnu_osabi |= elf_gnu_osabi_unique;
+      type = BSF_OBJECT | BSF_GNU_UNIQUE;
+    }
   else if (strcmp (typename, "notype") == 0
 	   || strcmp (typename, "STT_NOTYPE") == 0)
     ;

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

only message in thread, other threads:[~2023-08-24  3:07 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-08-24  3:07 [binutils-gdb] kvx: fix handling of STB_GNU_UNIQUE symbols Alan Modra

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).