* [PATCH] [arch/i386/boot]: for better readability in clearing BSS
@ 2007-08-25 9:54 Denis Cheng
2007-08-26 23:52 ` H. Peter Anvin
2007-08-26 23:57 ` H. Peter Anvin
0 siblings, 2 replies; 3+ messages in thread
From: Denis Cheng @ 2007-08-25 9:54 UTC (permalink / raw)
To: H. Peter Anvin; +Cc: Linux-Kernel, cr_quan
there are three different linker scripts with different usages,
arch/i386/boot/setup.ld
arch/i386/boot/compressed/vmlinux.lds
arch/i386/kernel/vmlinux.lds
accompanlying with three different sections of clearing BSS,
arch/i386/boot/header.S
arch/i386/boot/compressed/head.S
arch/i386/kernel/head.S
but their label names in .bss section are different,
when reading these files, they are apt to confuse,
this patch kept them in the same style of clearing.
Signed-off-by: Denis Cheng <crquan@gmail.com>
---
arch/i386/boot/compressed/head.S | 2 +-
| 2 +-
arch/i386/boot/setup.ld | 4 ++--
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/arch/i386/boot/compressed/head.S b/arch/i386/boot/compressed/head.S
index f35ea22..e499db0 100644
--- a/arch/i386/boot/compressed/head.S
+++ b/arch/i386/boot/compressed/head.S
@@ -113,7 +113,7 @@ relocated:
* Clear BSS
*/
xorl %eax,%eax
- leal _edata(%ebx),%edi
+ leal _bss(%ebx),%edi
leal _end(%ebx), %ecx
subl %edi,%ecx
cld
--git a/arch/i386/boot/header.S b/arch/i386/boot/header.S
index 7f4a2c5..cd074c1 100644
--- a/arch/i386/boot/header.S
+++ b/arch/i386/boot/header.S
@@ -254,7 +254,7 @@ setup2:
# Zero the bss
movw $__bss_start, %di
- movw $_end+3, %cx
+ movw $__bss_end, %cx
xorl %eax, %eax
subw %di, %cx
shrw $2, %cx
diff --git a/arch/i386/boot/setup.ld b/arch/i386/boot/setup.ld
index df9234b..f9d6897 100644
--- a/arch/i386/boot/setup.ld
+++ b/arch/i386/boot/setup.ld
@@ -36,15 +36,15 @@ SECTIONS
LONG(0x5a5aaa55)
}
-
. = ALIGN(16);
.bss :
{
__bss_start = .;
*(.bss)
+ . = ALIGN(16);
__bss_end = .;
}
- . = ALIGN(16);
+
_end = .;
/DISCARD/ : { *(.note*) }
--
1.5.3.rc4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] [arch/i386/boot]: for better readability in clearing BSS
2007-08-25 9:54 [PATCH] [arch/i386/boot]: for better readability in clearing BSS Denis Cheng
@ 2007-08-26 23:52 ` H. Peter Anvin
2007-08-26 23:57 ` H. Peter Anvin
1 sibling, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2007-08-26 23:52 UTC (permalink / raw)
To: Denis Cheng; +Cc: Linux-Kernel, cr_quan
Denis Cheng wrote:
>
> but their label names in .bss section are different,
> when reading these files, they are apt to confuse,
>
> this patch kept them in the same style of clearing.
>
Bullsh*t.
> diff --git a/arch/i386/boot/compressed/head.S b/arch/i386/boot/compressed/head.S
> index f35ea22..e499db0 100644
> --- a/arch/i386/boot/compressed/head.S
> +++ b/arch/i386/boot/compressed/head.S
> @@ -113,7 +113,7 @@ relocated:
> * Clear BSS
> */
> xorl %eax,%eax
> - leal _edata(%ebx),%edi
> + leal _bss(%ebx),%edi
> leal _end(%ebx), %ecx
> subl %edi,%ecx
> cld
Here you change _edata.._end into _bss.._end.
> diff --git a/arch/i386/boot/header.S b/arch/i386/boot/header.S
> index 7f4a2c5..cd074c1 100644
> --- a/arch/i386/boot/header.S
> +++ b/arch/i386/boot/header.S
> @@ -254,7 +254,7 @@ setup2:
>
> # Zero the bss
> movw $__bss_start, %di
> - movw $_end+3, %cx
> + movw $__bss_end, %cx
> xorl %eax, %eax
> subw %di, %cx
> shrw $2, %cx
Here you change __bss_start..to __bss_end, and have to change the linker
script for it not to break.
There is no consistency improvement, and as such, it's just churn.
-hpa
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] [arch/i386/boot]: for better readability in clearing BSS
2007-08-25 9:54 [PATCH] [arch/i386/boot]: for better readability in clearing BSS Denis Cheng
2007-08-26 23:52 ` H. Peter Anvin
@ 2007-08-26 23:57 ` H. Peter Anvin
1 sibling, 0 replies; 3+ messages in thread
From: H. Peter Anvin @ 2007-08-26 23:57 UTC (permalink / raw)
To: Denis Cheng; +Cc: Linux-Kernel, cr_quan
Denis Cheng wrote:
>
> but their label names in .bss section are different,
> when reading these files, they are apt to confuse,
>
> this patch kept them in the same style of clearing.
>
Bullsh*t.
> diff --git a/arch/i386/boot/compressed/head.S b/arch/i386/boot/compressed/head.S
> index f35ea22..e499db0 100644
> --- a/arch/i386/boot/compressed/head.S
> +++ b/arch/i386/boot/compressed/head.S
> @@ -113,7 +113,7 @@ relocated:
> * Clear BSS
> */
> xorl %eax,%eax
> - leal _edata(%ebx),%edi
> + leal _bss(%ebx),%edi
> leal _end(%ebx), %ecx
> subl %edi,%ecx
> cld
Here you change _edata.._end into _bss.._end.
> diff --git a/arch/i386/boot/header.S b/arch/i386/boot/header.S
> index 7f4a2c5..cd074c1 100644
> --- a/arch/i386/boot/header.S
> +++ b/arch/i386/boot/header.S
> @@ -254,7 +254,7 @@ setup2:
>
> # Zero the bss
> movw $__bss_start, %di
> - movw $_end+3, %cx
> + movw $__bss_end, %cx
> xorl %eax, %eax
> subw %di, %cx
> shrw $2, %cx
Here you change __bss_start.._end to __bss_start..__bss_end, and have to
change the linker script for it not to break.
There is no consistency improvement, and as such, it's just churn.
-hpa
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-08-26 23:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-08-25 9:54 [PATCH] [arch/i386/boot]: for better readability in clearing BSS Denis Cheng
2007-08-26 23:52 ` H. Peter Anvin
2007-08-26 23:57 ` H. Peter Anvin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox