lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-id: <alpine.DEB.2.00.1001110235490.30805@zirkon.biophys.uni-duesseldorf.de>
Date:	Mon, 11 Jan 2010 03:28:43 +0100 (CET)
From:	Michael Schmitz <schmitz@...phys.uni-duesseldorf.de>
To:	Andreas Schwab <schwab@...ux-m68k.org>
Cc:	Tim Abbott <tabbott@...lice.com>,
	Geert Uytterhoeven <geert@...ux-m68k.org>,
	linux-m68k@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: "m68k: Cleanup linker scripts using new linker script macros." and
 old binutils (was: Re: [PATCH] m68k: Atari EtherNAT - Nicolas Pitre has a new
 email address)

Hi Andreas,

> > FWIW: when stripping the new kernel, I get this warning:
> >
> > BFD: st7CwWnM: warning: allocated section `.init_end' not in segment
> 
> This is actually your problem.  The .init_end section is kind of special
> because it only contains an ALIGN.  What do you get from running
> "readelf -l vmlinux"?

Current LD script:
schmitz@...or:/org/kernel/linux2.6-m68k-git/linux-m68k$ readelf -l 
vmlinux-newlds

Elf file type is EXEC (Executable file)
Entry point 0x2000
There are 2 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x2d3240 0x2f0d14 RWE 0x2000
  LOAD           0x2d5000 0x002f1000 0x002f1000 0x1aed0 0x1aed0 RWE 0x2000

 Section to Segment mapping:
  Segment Sections...
   00     .text __ex_table .rodata __ksymtab __ksymtab_gpl __ksymtab_strings __param .data .bss 
   01     .init.text .init.data .m68k_fixup 

Old (working) LD script:

schmitz@...or:/org/kernel/linux2.6-m68k-git/linux-m68k$ readelf -l 
vmlinux-oldlds

Elf file type is EXEC (Executable file)
Entry point 0x2000
There are 2 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x2d0240 0x2edd14 RWE 0x2000
  LOAD           0x2d2000 0x002ee000 0x002ee000 0x20000 0x20000 RWE 0x2000

 Section to Segment mapping:
  Segment Sections...
   00     .text __ex_table .rodata __ksymtab __ksymtab_gpl __ksymtab_strings __param .data .bss 
   01     .init.text .init.data .init.setup .initcall.init .con_initcall.init .m68k_fixup .init.ramfs .data.init_task 

Looks like the size of the BSS segment is not aligned in the broken case. 

Putting this into the script:

--- arch/m68k/kernel/vmlinux-std.lds.org	2010-01-09 11:01:05.000000000 
+1300
+++ arch/m68k/kernel/vmlinux-std.lds	2010-01-11 09:40:24.000000000 +1300
@@ -51,6 +51,10 @@
 	__init_end = .;
   }
 
+  . = . + 0x1000;
+
+  . = ALIGN(8192);
+
   _end = . ;
 
   STABS_DEBUG

does place both __init_end and _end on separate aligned boundaries but leaves
the end of the actual BSS unaligned. 

Geert's kernel has this readelf output:

schmitz@...or:/org/m68k/aranym$ readelf -l 
vmlinux-2.6.33-rc2-atari-00203-gdd8abd9

Elf file type is EXEC (Executable file)
Entry point 0x2000
There are 2 program headers, starting at offset 52

Program Headers:
  Type           Offset   VirtAddr   PhysAddr   FileSiz MemSiz  Flg Align
  LOAD           0x000000 0x00000000 0x00000000 0x2de440 0x2fb450 RWE 0x2000
  LOAD           0x2e0000 0x002fc000 0x002fc000 0x1cf4c 0x1d000 RWE 0x2000

 Section to Segment mapping:
  Segment Sections...
   00     .text __ex_table .rodata __ksymtab __ksymtab_gpl __ksymtab_strings __param .data .bss 
   01     .init.text .init.data .m68k_fixup .notes .init_end 

The end of the BSS in memory is aligned here. 

What is needed in the script to force this alignment? How do I place a null byte 
right at __init_end ?? 

Thanks,

	Michael
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ