Skip to content

Commit

Permalink
FRV: Fix linkage problems
Browse files Browse the repository at this point in the history
Make it possible to use __start_notes and __stop_notes without getting a GPREL
overflow error from the FRV linker.

Small variables that would otherwise be in .data or .bss may, depending on the
arch, be placed in special sections (.sdata or .sbss) that permit single
instruction references on fixed instruction width machines.

__start_notes and __stop_notes aren't really char variables, and certainly
don't refer to data in .data or .bss.  Making them type "void" fools the
compiler into not assuming anything about them.

Signed-off-by: David Howells <dhowells@redhat.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
dhowells authored and Linus Torvalds committed Jul 20, 2007
1 parent 03ce110 commit 0b1937a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions kernel/ksysfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ KERNEL_ATTR_RO(kexec_crash_loaded);
/*
* Make /sys/kernel/notes give the raw contents of our kernel .notes section.
*/
extern const char __start_notes __attribute__((weak));
extern const char __stop_notes __attribute__((weak));
extern const void __start_notes __attribute__((weak));
extern const void __stop_notes __attribute__((weak));
#define notes_size (&__stop_notes - &__start_notes)

static ssize_t notes_read(struct kobject *kobj, struct bin_attribute *bin_attr,
Expand Down

0 comments on commit 0b1937a

Please sign in to comment.