lkml.org 
[lkml]   [2014]   [Jan]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[tip:x86/build] x86, boot: Use __attribute__((used)) to ensure videocard structs are emitted
Commit-ID:  2852657a9cf18a3bdb5842a13261bb1cc971572a
Gitweb: http://git.kernel.org/tip/2852657a9cf18a3bdb5842a13261bb1cc971572a
Author: David Woodhouse <David.Woodhouse@intel.com>
AuthorDate: Wed, 8 Jan 2014 11:21:21 +0000
Committer: H. Peter Anvin <hpa@linux.intel.com>
CommitDate: Tue, 21 Jan 2014 17:59:33 -0800

x86, boot: Use __attribute__((used)) to ensure videocard structs are emitted

It looks like GCC will always emit an object that is marked with an
explicit section, although the documentation doesn't say that and we
possibly shouldn't be relying on it.

Clang does *not* do so, so add __attribute__((used)) to make sure.

Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Link: http://lkml.kernel.org/r/1389180083-23249-2-git-send-email-David.Woodhouse@intel.com
Signed-off-by: H. Peter Anvin <hpa@linux.intel.com>
---
arch/x86/boot/video.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/boot/video.h b/arch/x86/boot/video.h
index ff339c5..0bb2549 100644
--- a/arch/x86/boot/video.h
+++ b/arch/x86/boot/video.h
@@ -80,7 +80,7 @@ struct card_info {
u16 xmode_n; /* Size of unprobed mode range */
};

-#define __videocard struct card_info __attribute__((section(".videocards")))
+#define __videocard struct card_info __attribute__((used,section(".videocards")))
extern struct card_info video_cards[], video_cards_end[];

int mode_defined(u16 mode); /* video.c */

\
 
 \ /
  Last update: 2014-01-22 04:01    [W:0.362 / U:0.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site