* What exactly is __ALIGN_STR in pnpbios/bioscalls.c for?
@ 2004-01-10 2:22 Adrian Bunk
0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2004-01-10 2:22 UTC (permalink / raw)
To: Adam Belay, Thomas Hood; +Cc: linux-kernel
Hi,
include/linux/linkage.h in kernel 2.6 includes #define's for __ALIGN and
__ALIGN_STR. In include/asm-i386/linkage.h, their values are changed
#ifdef CONFIG_X86_ALIGNMENT_16.
It isn't obvious what exacly CONFIG_X86_ALIGNMENT_16 is for (I've heard
more than one opinion), and since the __ALIGN_STR usage in
drivers/pnp/pnpbios/bioscalls.c is the only non-m68k usage of one of
these two #define's I wonder whether you might be able to enlighten me
what CONFIG_X86_ALIGNMENT_16 exactly is for?
TIA
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 5+ messages in thread
* What exactly is __ALIGN_STR in pnpbios/bioscalls.c for?
@ 2004-08-06 21:38 Adrian Bunk
0 siblings, 0 replies; 5+ messages in thread
From: Adrian Bunk @ 2004-08-06 21:38 UTC (permalink / raw)
To: Adam Belay, Thomas Hood; +Cc: linux-kernel
Hi,
include/linux/linkage.h in kernel 2.6 includes #define's for __ALIGN and
__ALIGN_STR. In include/asm-i386/linkage.h, their values are changed
#ifdef CONFIG_X86_ALIGNMENT_16.
It isn't obvious what exacly CONFIG_X86_ALIGNMENT_16 is for (I've heard
more than one opinion), and since the __ALIGN_STR usage in
drivers/pnp/pnpbios/bioscalls.c is the only non-m68k/ppc usage of one of
these two #define's I wonder whether you might be able to enlighten me
what CONFIG_X86_ALIGNMENT_16 exactly is for?
TIA
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 5+ messages in thread
* What exactly is __ALIGN_STR in pnpbios/bioscalls.c for?
@ 2004-11-21 17:56 Adrian Bunk
2004-11-21 20:29 ` Andreas Schwab
0 siblings, 1 reply; 5+ messages in thread
From: Adrian Bunk @ 2004-11-21 17:56 UTC (permalink / raw)
To: Adam Belay, Thomas Hood; +Cc: linux-kernel
Hi,
include/linux/linkage.h in kernel 2.6 includes #define's for __ALIGN and
__ALIGN_STR. In include/asm-i386/linkage.h, their values are changed
#ifdef CONFIG_X86_ALIGNMENT_16.
It isn't obvious what exacly CONFIG_X86_ALIGNMENT_16 is for (I've heard
more than one opinion), and since the __ALIGN_STR usage in
drivers/pnp/pnpbios/bioscalls.c is the only non-m68k usage of one of
these two #define's I wonder whether you might be able to enlighten me
what CONFIG_X86_ALIGNMENT_16 exactly is for?
TIA
Adrian
--
"Is there not promise of rain?" Ling Tan asked suddenly out
of the darkness. There had been need of rain for many days.
"Only a promise," Lao Er said.
Pearl S. Buck - Dragon Seed
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What exactly is __ALIGN_STR in pnpbios/bioscalls.c for?
2004-11-21 17:56 What exactly is __ALIGN_STR in pnpbios/bioscalls.c for? Adrian Bunk
@ 2004-11-21 20:29 ` Andreas Schwab
2004-11-21 22:17 ` Sam Ravnborg
0 siblings, 1 reply; 5+ messages in thread
From: Andreas Schwab @ 2004-11-21 20:29 UTC (permalink / raw)
To: Adrian Bunk; +Cc: Adam Belay, Thomas Hood, linux-kernel
Adrian Bunk <bunk@stusta.de> writes:
> include/linux/linkage.h in kernel 2.6 includes #define's for __ALIGN and
> __ALIGN_STR. In include/asm-i386/linkage.h, their values are changed
> #ifdef CONFIG_X86_ALIGNMENT_16.
>
> It isn't obvious what exacly CONFIG_X86_ALIGNMENT_16 is for (I've heard
> more than one opinion), and since the __ALIGN_STR usage in
> drivers/pnp/pnpbios/bioscalls.c is the only non-m68k usage of one of
> these two #define's I wonder whether you might be able to enlighten me
> what CONFIG_X86_ALIGNMENT_16 exactly is for?
It's for aligning function entries to a 16 byte boundary instead of only 4
bytes, used together with -malign-functions. See also the ENTRY macro.
Note that the default value of __ALIGN is actually useless for anything
but x86 and x86-64.
Andreas.
--
Andreas Schwab, SuSE Labs, schwab@suse.de
SuSE Linux Products GmbH, Maxfeldstraße 5, 90409 Nürnberg, Germany
Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
"And now for something completely different."
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: What exactly is __ALIGN_STR in pnpbios/bioscalls.c for?
2004-11-21 20:29 ` Andreas Schwab
@ 2004-11-21 22:17 ` Sam Ravnborg
0 siblings, 0 replies; 5+ messages in thread
From: Sam Ravnborg @ 2004-11-21 22:17 UTC (permalink / raw)
To: Andreas Schwab; +Cc: Adrian Bunk, Adam Belay, Thomas Hood, linux-kernel
On Sun, Nov 21, 2004 at 09:29:32PM +0100, Andreas Schwab wrote:
> Adrian Bunk <bunk@stusta.de> writes:
> It's for aligning function entries to a 16 byte boundary instead of only 4
> bytes, used together with -malign-functions. See also the ENTRY macro.
> Note that the default value of __ALIGN is actually useless for anything
> but x86 and x86-64.
Recently someone complained that __sched_text_start changed address during
pass one and two of kallsyms. The actual culprint was that an
address changed due to different section layout.
The fix I posted was to align .sched.text to an 8 byte boundary.
Can we say anything about alignment of functions across architectures?
Patch in question below.
Grepping tells me to use FUNCTION_ALIGN if I push this for inclusion.
Sam
===== include/asm-generic/vmlinux.lds.h 1.16 vs edited =====
--- 1.16/include/asm-generic/vmlinux.lds.h 2004-10-06 18:45:06 +02:00
+++ edited/include/asm-generic/vmlinux.lds.h 2004-11-06 21:56:11 +01:00
@@ -6,6 +6,11 @@
#define VMLINUX_SYMBOL(_sym_) _sym_
#endif
+/* Aling functions to a 8 byte boundary.
+ * This prevents lables defined to mark start/end of section to differ
+ * during pass 1 and pass 2 when generating System.map */
+#define ALIGN_FUNCTION() . = ALIGN(8)
+
#define RODATA \
.rodata : AT(ADDR(.rodata) - LOAD_OFFSET) { \
*(.rodata) *(.rodata.*) \
@@ -77,11 +82,13 @@
}
#define SCHED_TEXT \
+ ALIGN_FUNCTION(); \
VMLINUX_SYMBOL(__sched_text_start) = .; \
*(.sched.text) \
VMLINUX_SYMBOL(__sched_text_end) = .;
#define LOCK_TEXT \
+ ALIGN_FUNCTION(); \
VMLINUX_SYMBOL(__lock_text_start) = .; \
*(.spinlock.text) \
VMLINUX_SYMBOL(__lock_text_end) = .;
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2004-11-21 22:16 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-11-21 17:56 What exactly is __ALIGN_STR in pnpbios/bioscalls.c for? Adrian Bunk
2004-11-21 20:29 ` Andreas Schwab
2004-11-21 22:17 ` Sam Ravnborg
-- strict thread matches above, loose matches on Subject: below --
2004-08-06 21:38 Adrian Bunk
2004-01-10 2:22 Adrian Bunk
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.