diff mbox

init: fix build with older gcc

Message ID 576D197F02000078000F8687@prv-mh.provo.novell.com (mailing list archive)
State New, archived
Headers show

Commit Message

Jan Beulich June 24, 2016, 9:29 a.m. UTC
__setup_str is used on arrays of char, so there aren't any relocatable
items. Hence __initconst has to be used here, not __initconstrel.

Whatever led to the revert of commit 59b151d2c0 (the original version
of a6066af5b1 "xen/init: Annotate all command line parameter
infrastructure as const" must have got addressed meanwhile - with the
patch here I can't see that old gcc (4.3ish) report a section type
conflict anymore.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
init: fix build with older gcc

__setup_str is used on arrays of char, so there aren't any relocatable
items. Hence __initconst has to be used here, not __initconstrel.

Whatever led to the revert of commit 59b151d2c0 (the original version
of a6066af5b1 "xen/init: Annotate all command line parameter
infrastructure as const" must have got addressed meanwhile - with the
patch here I can't see that old gcc (4.3ish) report a section type
conflict anymore.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -88,7 +88,7 @@ struct kernel_param {
 
 extern const struct kernel_param __setup_start[], __setup_end[];
 
-#define __setup_str static const  __initconstrel \
+#define __setup_str static const __initconst \
     __attribute__((__aligned__(1))) char
 #define __kparam static const __initsetup \
     __attribute__((__aligned__(sizeof(void *)))) struct kernel_param

Comments

Andrew Cooper June 24, 2016, 9:32 a.m. UTC | #1
On 24/06/16 10:29, Jan Beulich wrote:
> __setup_str is used on arrays of char, so there aren't any relocatable
> items. Hence __initconst has to be used here, not __initconstrel.
>
> Whatever led to the revert of commit 59b151d2c0 (the original version
> of a6066af5b1 "xen/init: Annotate all command line parameter
> infrastructure as const" must have got addressed meanwhile - with the
> patch here I can't see that old gcc (4.3ish) report a section type
> conflict anymore.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/include/xen/init.h
> +++ b/xen/include/xen/init.h
> @@ -88,7 +88,7 @@ struct kernel_param {
>  
>  extern const struct kernel_param __setup_start[], __setup_end[];
>  
> -#define __setup_str static const  __initconstrel \
> +#define __setup_str static const __initconst \
>      __attribute__((__aligned__(1))) char
>  #define __kparam static const __initsetup \
>      __attribute__((__aligned__(sizeof(void *)))) struct kernel_param
>
>
>
diff mbox

Patch

--- a/xen/include/xen/init.h
+++ b/xen/include/xen/init.h
@@ -88,7 +88,7 @@  struct kernel_param {
 
 extern const struct kernel_param __setup_start[], __setup_end[];
 
-#define __setup_str static const  __initconstrel \
+#define __setup_str static const __initconst \
     __attribute__((__aligned__(1))) char
 #define __kparam static const __initsetup \
     __attribute__((__aligned__(sizeof(void *)))) struct kernel_param