diff options
-rw-r--r-- | rts/Libdw.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/rts/Libdw.c b/rts/Libdw.c index d45d9d0e5d..c0d7c9a4b1 100644 --- a/rts/Libdw.c +++ b/rts/Libdw.c @@ -133,8 +133,15 @@ int libdwLookupLocation(LibdwSession *session, Location *frame, Dwfl_Module *mod = dwfl_addrmodule(session->dwfl, addr); if (mod == NULL) return 1; + + // avoid unaligned pointer value + // Using &frame->object_file as argument to dwfl_module_info leads to + // + // error: taking address of packed member of ‘struct Location_’ may result in an unaligned pointer value [-Werror=address-of-packed-member] + // + void *object_file = &frame->object_file; dwfl_module_info(mod, NULL, NULL, NULL, NULL, NULL, - &frame->object_file, NULL); + object_file, NULL); // Find function name frame->function = dwfl_module_addrname(mod, addr); |