Re: [PATCH 6/7] Add /sys/kernel/notes

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Roland McGrath <roland@...>
Cc: Linus Torvalds <torvalds@...>, <linux-kernel@...>
Date: Wednesday, July 11, 2007 - 7:45 pm

On Wed, 11 Jul 2007 12:04:34 -0700 (PDT)
Roland McGrath <roland@frob.com> wrote:


I'm curios to know what happens if nobody defines __start_notes and
__end_notes.  We'll use the extern-attribute-weak thing, but those two
locations won't even get instantiated in vmlinux, I think.

And the code relies upon the difference between two non-existent
attribute-weak locations being zero.



akpm:/home/akpm> cat t.c

#include <stdio.h>

extern const char __start_notes __attribute__((weak));
extern const char __stop_notes __attribute__((weak));

main()
{
	int a = &__stop_notes - &__start_notes;
	
	printf("%d\n", a);
}

akpm:/home/akpm> gcc -g t.c
akpm:/home/akpm> ./a.out
0
akpm:/home/akpm> nm a.out|grep notes
         w __start_notes
         w __stop_notes

So it all works OK on this toolchain.  But is it _supposed_ to work?  Are
we venturing into unexplored binutils territory here?

-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 6/7] Add /sys/kernel/notes, Roland McGrath, (Wed Jul 11, 3:04 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Andrew Morton, (Wed Jul 11, 7:45 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Roland McGrath, (Wed Jul 11, 8:37 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Jeremy Fitzhardinge, (Wed Jul 11, 7:57 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Roland McGrath, (Wed Jul 11, 8:42 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Jeremy Fitzhardinge, (Wed Jul 11, 10:41 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Linus Torvalds, (Wed Jul 11, 3:16 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Roland McGrath, (Wed Jul 11, 4:51 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Linus Torvalds, (Wed Jul 11, 5:45 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Roland McGrath, (Wed Jul 11, 6:04 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Linus Torvalds, (Wed Jul 11, 6:17 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Roland McGrath, (Wed Jul 11, 6:42 pm)
Re: [PATCH 6/7] Add /sys/kernel/notes, Linus Torvalds, (Wed Jul 11, 6:48 pm)