summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc Poulhiès <poulhies@adacore.com>2023-01-12 16:13:45 +0100
committerMarc Poulhiès <poulhies@adacore.com>2023-05-16 10:30:57 +0200
commit2ffa7a68401b0f40360f7bd3dfcecc8e34ff7c14 (patch)
tree436dcdd9043becb9696bfa7a2a2eca46507f0f68
parent6c0b94efaa811e7234c9ae790927d3741542935f (diff)
downloadgcc-2ffa7a68401b0f40360f7bd3dfcecc8e34ff7c14.tar.gz
ada: Fix Ada representation of r_debug and link_map types
Both record types need to have their components 'aliased' to match their C version. The mismatch could be observed when using LTO: warning: type of 'r_debug' does not match original declaration [-Wlto-type-mismatch] /usr/include/link.h:66:23: note: type 'struct r_debug' should match type 'struct system__traceback__symbolic__module_name__build_... ...cache_for_all_modules__r_debug_type' gcc/ada/ * libgnat/s-tsmona__linux.adb (link_map, r_debug_type): Add 'aliased' on all components.
-rw-r--r--gcc/ada/libgnat/s-tsmona__linux.adb19
1 files changed, 13 insertions, 6 deletions
diff --git a/gcc/ada/libgnat/s-tsmona__linux.adb b/gcc/ada/libgnat/s-tsmona__linux.adb
index 7e1b493c991..6b539f13c16 100644
--- a/gcc/ada/libgnat/s-tsmona__linux.adb
+++ b/gcc/ada/libgnat/s-tsmona__linux.adb
@@ -93,23 +93,30 @@ package body Module_Name is
pragma Convention (C, link_map_acc);
type link_map is record
- l_addr : Address;
+ l_addr : aliased Address;
-- Base address of the shared object
- l_name : Address;
+ l_name : aliased Address;
-- Null-terminated absolute file name
- l_ld : Address;
+ l_ld : aliased Address;
-- Dynamic section
- l_next, l_prev : link_map_acc;
+ l_next, l_prev : aliased link_map_acc;
-- Chain
end record;
pragma Convention (C, link_map);
+ type r_debug_state is (RT_CONSISTENT, RT_ADD, RT_DELETE);
+ pragma Convention (C, r_debug_state);
+ pragma Unreferenced (RT_CONSISTENT, RT_ADD, RT_DELETE);
+
type r_debug_type is record
- r_version : Integer;
- r_map : link_map_acc;
+ r_version : aliased int;
+ r_map : aliased link_map_acc;
+ r_brk : aliased Address;
+ r_state : aliased r_debug_state;
+ r_ldbase : aliased Address;
end record;
pragma Convention (C, r_debug_type);