* [PATCH] backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c.
@ 2017-10-24 12:35 Mark Wielaard
2017-10-26 14:28 ` Mark Wielaard
0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2017-10-24 12:35 UTC (permalink / raw)
To: elfutils-devel; +Cc: Mark Wielaard
The GCC8 -Wpacked-not-aligned warns if a structure field with explicit
padding in a packed structure will be misaligned. m68k prstatus core
notes are described by a packed structure which has such aligned structure
fields.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
backends/ChangeLog | 4 ++++
backends/Makefile.am | 7 +++++++
config/ChangeLog | 4 ++++
config/eu.am | 1 +
4 files changed, 16 insertions(+)
diff --git a/backends/ChangeLog b/backends/ChangeLog
index 8c3f42c..8e7fecc 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-24 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (m68k_corenote_Wpacked_not_aligned): New variable.
+
2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
* linux-core-note.c: Use attribute_packed.
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 0fde0cb..306c4a6 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -119,6 +119,13 @@ m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c \
libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
+# m68k prstatus core notes are described by a packed structure
+# which has not naturally aligned fields. Since we don't access
+# these fields directly, but take their offset to be used later
+# to extract the data through elfxx_xlatetom/memmove, this isn't
+# an issue.
+m68k_corenote_Wpacked_not_aligned = yes
+
bpf_SRCS = bpf_init.c bpf_regs.c
cpu_bpf = ../libcpu/libcpu_bpf.a
libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
diff --git a/config/ChangeLog b/config/ChangeLog
index 1ed3c4a..de0d890 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-24 Mark Wielaard <mark@klomp.org>
+
+ * eu.am (AM_CFLAGS): Handle -Wno-packed-not-aligned.
+
2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
* eu.am: Use fpic_CFLAGS.
diff --git a/config/eu.am b/config/eu.am
index 796f388..fb039e2 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -74,6 +74,7 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
$(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
+ $(if $($(*F)_no_Wpacked_not_aligned),,-Wno-packed-not-aligned) \
$($(*F)_CFLAGS)
COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c.
2017-10-24 12:35 [PATCH] backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c Mark Wielaard
@ 2017-10-26 14:28 ` Mark Wielaard
2017-10-30 8:54 ` Mark Wielaard
0 siblings, 1 reply; 3+ messages in thread
From: Mark Wielaard @ 2017-10-26 14:28 UTC (permalink / raw)
To: elfutils-devel
[-- Attachment #1: Type: text/plain, Size: 1186 bytes --]
On Tue, 2017-10-24 at 14:35 +0200, Mark Wielaard wrote:
> The GCC8 -Wpacked-not-aligned warns if a structure field with explicit
> padding in a packed structure will be misaligned. m68k prstatus core
> notes are described by a packed structure which has such aligned structure
> fields.
Well, that worked, but only because of two typos canceling each other
out...
> +# m68k prstatus core notes are described by a packed structure
> +# which has not naturally aligned fields. Since we don't access
> +# these fields directly, but take their offset to be used later
> +# to extract the data through elfxx_xlatetom/memmove, this isn't
> +# an issue.
> +m68k_corenote_Wpacked_not_aligned = yes
Missing no_ ...
> +++ b/config/eu.am
> @@ -74,6 +74,7 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
> > $(if $($(*F)_no_Werror),,-Werror) \
> > $(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
> > $(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
> > + $(if $($(*F)_no_Wpacked_not_aligned),,-Wno-packed-not-aligned) \
Double ,, causing everything to get -Wno-packaged-not-aligned.
Oops. Fixed patch attached.
[-- Attachment #2: Type: text/x-patch, Size: 2595 bytes --]
From ab6b37ac32ddf2f2f11f800a770170814f5cbb8b Mon Sep 17 00:00:00 2001
From: Mark Wielaard <mark@klomp.org>
Date: Tue, 24 Oct 2017 14:23:30 +0200
Subject: [PATCH] backends: Ignore GCC8 -Wpacked-not-aligned for
m68k_corenote.c.
The GCC8 -Wpacked-not-aligned warns if a structure field with explicit
padding in a packed structure will be misaligned. m68k prstatus core
notes are described by a packed structure which has such aligned structure
fields.
Signed-off-by: Mark Wielaard <mark@klomp.org>
---
backends/ChangeLog | 4 ++++
backends/Makefile.am | 7 +++++++
config/ChangeLog | 4 ++++
config/eu.am | 1 +
4 files changed, 16 insertions(+)
diff --git a/backends/ChangeLog b/backends/ChangeLog
index 8c3f42c..190ae96 100644
--- a/backends/ChangeLog
+++ b/backends/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-24 Mark Wielaard <mark@klomp.org>
+
+ * Makefile.am (m68k_corenote_no_Wpacked_not_aligned): New variable.
+
2017-08-18 Ulf Hermann <ulf.hermann@qt.io>
* linux-core-note.c: Use attribute_packed.
diff --git a/backends/Makefile.am b/backends/Makefile.am
index 0fde0cb..2c62add 100644
--- a/backends/Makefile.am
+++ b/backends/Makefile.am
@@ -119,6 +119,13 @@ m68k_SRCS = m68k_init.c m68k_symbol.c m68k_regs.c \
libebl_m68k_pic_a_SOURCES = $(m68k_SRCS)
am_libebl_m68k_pic_a_OBJECTS = $(m68k_SRCS:.c=.os)
+# m68k prstatus core notes are described by a packed structure
+# which has not naturally aligned fields. Since we don't access
+# these fields directly, but take their offset to be used later
+# to extract the data through elfxx_xlatetom/memmove, this isn't
+# an issue.
+m68k_corenote_no_Wpacked_not_aligned = yes
+
bpf_SRCS = bpf_init.c bpf_regs.c
cpu_bpf = ../libcpu/libcpu_bpf.a
libebl_bpf_pic_a_SOURCES = $(bpf_SRCS)
diff --git a/config/ChangeLog b/config/ChangeLog
index 1ed3c4a..de0d890 100644
--- a/config/ChangeLog
+++ b/config/ChangeLog
@@ -1,3 +1,7 @@
+2017-10-24 Mark Wielaard <mark@klomp.org>
+
+ * eu.am (AM_CFLAGS): Handle -Wno-packed-not-aligned.
+
2017-04-27 Ulf Hermann <ulf.hermann@qt.io>
* eu.am: Use fpic_CFLAGS.
diff --git a/config/eu.am b/config/eu.am
index 796f388..05c27f0 100644
--- a/config/eu.am
+++ b/config/eu.am
@@ -74,6 +74,7 @@ AM_CFLAGS = -std=gnu99 -Wall -Wshadow -Wformat=2 \
$(if $($(*F)_no_Werror),,-Werror) \
$(if $($(*F)_no_Wunused),,-Wunused -Wextra) \
$(if $($(*F)_no_Wstack_usage),,$(STACK_USAGE_WARNING)) \
+ $(if $($(*F)_no_Wpacked_not_aligned),-Wno-packed-not-aligned,) \
$($(*F)_CFLAGS)
COMPILE.os = $(filter-out -fprofile-arcs -ftest-coverage, $(COMPILE))
--
1.8.3.1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c.
2017-10-26 14:28 ` Mark Wielaard
@ 2017-10-30 8:54 ` Mark Wielaard
0 siblings, 0 replies; 3+ messages in thread
From: Mark Wielaard @ 2017-10-30 8:54 UTC (permalink / raw)
To: elfutils-devel
On Thu, 2017-10-26 at 16:28 +0200, Mark Wielaard wrote:
> The GCC8 -Wpacked-not-aligned warns if a structure field with
> explicit padding in a packed structure will be misaligned. m68k
> prstatus core notes are described by a packed structure which has
> such aligned structure fields.
And now pushed to master.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-10-30 8:54 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-24 12:35 [PATCH] backends: Ignore GCC8 -Wpacked-not-aligned for m68k_corenote.c Mark Wielaard
2017-10-26 14:28 ` Mark Wielaard
2017-10-30 8:54 ` Mark Wielaard
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).