public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r14-9221] btf: fix type id in BTF_KIND_FUNC struct data.
@ 2024-02-28 19:23 Cupertino Miranda
  0 siblings, 0 replies; only message in thread
From: Cupertino Miranda @ 2024-02-28 19:23 UTC (permalink / raw)
  To: gcc-cvs

https://gcc.gnu.org/g:0198cade5ac15c35ed3f5af54060d7bc6a39f326

commit r14-9221-g0198cade5ac15c35ed3f5af54060d7bc6a39f326
Author: Cupertino Miranda <cupertino.miranda@oracle.com>
Date:   Tue Jan 30 19:01:12 2024 +0000

    btf: fix type id in BTF_KIND_FUNC struct data.
    
    This patch corrects the addition of +1 on the type id, which originally
    was done in the wrong location and led to func_dtd->dtd_type for
    BTF_KIND_FUNC struct data to contain the type id of the previous entry.
    
    gcc/ChangeLog:
    
            * btfout.cc (btf_collect_dataset): Corrects BTF type id.

Diff:
---
 gcc/btfout.cc | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/gcc/btfout.cc b/gcc/btfout.cc
index dcf751f8fe0..7e114e22444 100644
--- a/gcc/btfout.cc
+++ b/gcc/btfout.cc
@@ -457,7 +457,8 @@ btf_collect_datasec (ctf_container_ref ctfc)
       func_dtd->dtd_data.ctti_type = dtd->dtd_type;
       func_dtd->linkage = dtd->linkage;
       func_dtd->dtd_name = dtd->dtd_name;
-      func_dtd->dtd_type = num_types_added + num_types_created;
+      /* +1 for the sentinel type not in the types map.  */
+      func_dtd->dtd_type = num_types_added + num_types_created + 1;
 
       /* Only the BTF_KIND_FUNC type actually references the name. The
 	 BTF_KIND_FUNC_PROTO is always anonymous.  */
@@ -480,8 +481,7 @@ btf_collect_datasec (ctf_container_ref ctfc)
 
 	  struct btf_var_secinfo info;
 
-	  /* +1 for the sentinel type not in the types map.  */
-	  info.type = func_dtd->dtd_type + 1;
+	  info.type = func_dtd->dtd_type;
 
 	  /* Both zero at compile time.  */
 	  info.size = 0;

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

only message in thread, other threads:[~2024-02-28 19:23 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-28 19:23 [gcc r14-9221] btf: fix type id in BTF_KIND_FUNC struct data Cupertino Miranda

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