blob: cf4d1dfe75bd5c7a4c158488638b6b9645729a36 [file] [log] [blame]
Brad Bishop316dfdd2018-06-25 12:45:53 -04001From 732913a8c35c7b25c0cbf6903cab1ad6b602b525 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 22 Mar 2018 22:44:03 -0700
4Subject: [PATCH] Ensure that packed structs follow the gcc memory layout
5
6Partial backport of
7https://sourceware.org/git/?p=elfutils.git;a=commit;h=17d7194d291bf91d130b78e06cbe27b290e0376d
8
9Helps fixing alignment errors e.g.
10linux-core-note.c:116:1: error: alignment 2 of 'struct m68k_prstatus
11' is less than 4 [-Werror=packed-not-aligned]
12 ;
13 ^
14
15Upstream-Status: Backport [https://sourceware.org/git/?p=elfutils.git;a=commit;h=17d7194d291bf91d130b78e06cbe27b290e0376d]
16
17Signed-off-by: Khem Raj <raj.khem@gmail.com>
18---
19 backends/linux-core-note.c | 2 +-
20 1 file changed, 1 insertion(+), 1 deletion(-)
21
22diff --git a/backends/linux-core-note.c b/backends/linux-core-note.c
23index 5f06c896..9faae4c3 100644
24--- a/backends/linux-core-note.c
25+++ b/backends/linux-core-note.c
26@@ -111,7 +111,7 @@ struct EBLHOOK(prstatus)
27 FIELD (INT, pr_fpvalid);
28 }
29 #ifdef ALIGN_PRSTATUS
30- __attribute__ ((packed, aligned (ALIGN_PRSTATUS)))
31+ attribute_packed __attribute__ ((aligned (ALIGN_PRSTATUS)))
32 #endif
33 ;
34