Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:ALP:Source:Standard:Core:0.1
dwarves
0005-core-Record-if-a-CU-has-a-DW_TAG_unspecifi...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0005-core-Record-if-a-CU-has-a-DW_TAG_unspecified_type.patch of Package dwarves
From 0d8c32c4b61de23acfe46e089d3470bbd02ce339 Mon Sep 17 00:00:00 2001 From: Arnaldo Carvalho de Melo <acme@redhat.com> Date: Mon, 10 Oct 2022 09:42:30 -0300 Subject: [PATCH 5/7] core: Record if a CU has a DW_TAG_unspecified_type So that the BTF encoder can turn such functions into returning void instead, as BTF doesn't have a representation for such tags. First noticed with Linux circa v6.1 built with GNU AS 2.39.50, git HEAD at the time building a .S file where the entry_ibpb assembly "function" was encoded as DWARF with DW_TAG_unspecified_type as its return type. Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com> --- dwarf_loader.c | 7 ++++++- dwarves.h | 8 ++++++++ 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/dwarf_loader.c b/dwarf_loader.c index c2ad2a03dbbf24c0..41ba36bcd375f670 100644 --- a/dwarf_loader.c +++ b/dwarf_loader.c @@ -2000,9 +2000,11 @@ static struct tag *__die__process_tag(Dwarf_Die *die, struct cu *cu, case DW_TAG_imported_module: case DW_TAG_reference_type: case DW_TAG_restrict_type: - case DW_TAG_unspecified_type: case DW_TAG_volatile_type: tag = die__create_new_tag(die, cu); break; + case DW_TAG_unspecified_type: + cu->unspecified_type.tag = + tag = die__create_new_tag(die, cu); break; case DW_TAG_pointer_type: tag = die__create_new_pointer_tag(die, cu, conf); break; case DW_TAG_ptr_to_member_type: @@ -2063,6 +2065,8 @@ static int die__process_unit(Dwarf_Die *die, struct cu *cu, struct conf_load *co cu__hash(cu, tag); struct dwarf_tag *dtag = tag->priv; dtag->small_id = id; + if (tag->tag == DW_TAG_unspecified_type) + cu->unspecified_type.type = id; } while (dwarf_siblingof(die, die) == 0); return 0; @@ -2498,6 +2502,7 @@ static int cu__recode_dwarf_types_table(struct cu *cu, if (tag__recode_dwarf_type(tag, cu)) return -1; } + return 0; } diff --git a/dwarves.h b/dwarves.h index 2d0f51ab39df1fbd..f152a9fafbba83c1 100644 --- a/dwarves.h +++ b/dwarves.h @@ -230,6 +230,10 @@ struct debug_fmt_ops { bool has_alignment_info; }; +/* + * unspecified_type: If this CU has a DW_TAG_unspecified_type, as BTF doesn't have a representation for this + * and thus we need to check functions returning this to convert it to void. + */ struct cu { struct list_head node; struct list_head tags; @@ -238,6 +242,10 @@ struct cu { struct ptr_table functions_table; struct ptr_table tags_table; struct rb_root functions; + struct { + struct tag *tag; + uint32_t type; + } unspecified_type; char *name; char *filename; void *priv; -- 2.39.1
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor