From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754917AbbDHWf5 (ORCPT ); Wed, 8 Apr 2015 18:35:57 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:60346 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754722AbbDHWf4 (ORCPT ); Wed, 8 Apr 2015 18:35:56 -0400 Date: Wed, 8 Apr 2015 15:35:54 -0700 From: Andrew Morton To: Andi Kleen Cc: linux-kernel@vger.kernel.org, Andi Kleen Subject: Re: [PATCH 2/2] test-hexdump.c: Fix initconst confusion Message-Id: <20150408153554.65c87de78f1c2289483f67e8@linux-foundation.org> In-Reply-To: <1428498405-7019-2-git-send-email-andi@firstfloor.org> References: <1428498405-7019-1-git-send-email-andi@firstfloor.org> <1428498405-7019-2-git-send-email-andi@firstfloor.org> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 8 Apr 2015 06:06:45 -0700 Andi Kleen wrote: > From: Andi Kleen > > const char *...[] is not const, but an array of pointer to const. > So these arrays cannot be __initconst, but must be __initdata > > This fixes section conflicts with LTO. > > --- a/lib/test-hexdump.c > +++ b/lib/test-hexdump.c > @@ -18,26 +18,26 @@ static const unsigned char data_b[] = { > > static const unsigned char data_a[] = ".2.{....p..$}.4...1.....L...C..."; > > -static const char *test_data_1_le[] __initconst = { > +static const char * const test_data_1_le[] __initconst = { const char * const __initconst > "be", "32", "db", "7b", "0a", "18", "93", "b2", > "70", "ba", "c4", "24", "7d", "83", "34", "9b", > "a6", "9c", "31", "ad", "9c", "0f", "ac", "e9", > "4c", "d1", "19", "99", "43", "b1", "af", "0c", > }; > > +static const char *test_data_2_le[] __initdata = { > +static const char *test_data_4_le[] __initdata = { > +static const char *test_data_8_le[] __initdata = { const char * __initdata Why is test_data_1_le[] different? Can we make them all "const char * const __initconst"? That would make checkpatch happy ;)