Skip to content

Commit

Permalink
x86, boot: Use __attribute__((used)) to ensure videocard structs are …
Browse files Browse the repository at this point in the history
…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>
  • Loading branch information
David Woodhouse authored and H. Peter Anvin committed Jan 22, 2014
1 parent 1c678da commit 9b3965f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion arch/x86/boot/video.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 9b3965f

Please sign in to comment.