Note that there are some explanatory texts on larger screens.

plurals
  1. POMy bootloader can't be compiled with gcc 4.6 and 4.7 ... only 4.5
    primarykey
    data
    text
    <p>I created my bootloader before 2 years under debian squeeze/stable with <code>gcc</code> 4.5. Now in debian wheezy/sid can't be compiled with 4.6 and 4.7 because creates bigger sections from these i expecting to produce the final binary by hand. This is not problem for me now since in debian wheezy/sid the <code>gcc</code> 4.5 is still there but i 'd like to make it possible to be compiled with <code>gcc</code> 4.6 and 4.7.</p> <p>I produce the final binary like this:</p> <p>the source files are compiled with:</p> <pre><code>gcc-4.5 -Wall -O3 -c -m32 -I. -o assemblybin-objects/vga_pm.S.o vga_pm.S </code></pre> <p>linked with:</p> <pre><code>ld -nostdlib -T binary.ld assemblybin-objects/vga_pm.S.o ... and other objects here ... -o bootloader.bin </code></pre> <p>the contents of the <code>binary.ld</code> is:</p> <pre><code>OUTPUT_FORMAT("binary","binary","binary") OUTPUT_ARCH(i386) SECTIONS { . = 0; .bootloader : { . = 0x600; *(.bootstrap); . = 0x7fa; BYTE(0x11); BYTE(0x33); BYTE(0x55); BYTE(0x77); BYTE(0x55); BYTE(0xaa); _bootstrap_end = .; . = 0x800; *(.sysinit); _sysinit_end = .; . = 0x1000; *(.pages); _pages_end = .; . = 0x5000; *(.sysconf); *(.presystem); *(.system); *(.library); *(.text); *(.data); *(.bss); *(.rodata); *(.rodata.*); . = 0xeffc; BYTE(0x11); BYTE(0x33); BYTE(0x55); BYTE(0x77); _system_end = .; } . = ASSERT(_bootstrap_end &lt;= 0x800,"Bootstrap section big!"); . = ASSERT(_sysinit_end &lt;= 0x1000,"Sysinit section big!"); . = ASSERT(_pages_end &lt;= 0x5000,"Pages section big!"); . = ASSERT(_system_end &lt;= 0xf000,"System initialization section big!"); } </code></pre> <p>at last creating the final binary with <code>dd</code>.</p> <p>I saw that when compiled with <code>gcc</code> 4.6 and 4.7 the linker adds some bytes (250-300) at the begin of the <code>bootloader.bin</code>.</p> <p>I'm using the <code>ld</code> from <code>binutils</code> 2.22 and cook with my own recipes for the build process.</p> <p>My actual questions are:</p> <p><strong>What are the differences between these versions of the <code>gcc</code> compiler and they produce bigger sections or instructing the linker through the elf object files to add these bytes at the begin of the <code>bootloader.bin</code> file?</strong></p> <p><strong>Is there any command line argument for <code>gcc</code> 4.6 and/or 4.7 which will turn off a feature that may produce bigger sections than the <code>gcc</code> 4.5 or to remove the instructions those saying the linker to add these bytes at the begin of the <code>bootloader.bin</code> file?</strong></p> <p>edit 17-08-2012: I'm lil busy these days but soon i 'll update with the results of tests i did.</p> <p>Answer to @strnk and @Dan Aloni: when i saw this problem the first i did is to exclude useless sections but the results are the same ... i think because the <code>bootloader.bin</code> is a simple binary with the linked code of the needed sections at the right position as the linker instructed to do, without section names, relocation and debug informations and symbols ... <code>bootloader.bin</code> file is not an elf object file.</p> <p>Please consider the changes of the actual questions. Thanks for everything ... i 'll be back soon</p> <p>edit 31-08-2012: Okay guys thanks for your help. The answer given by @Dan Aloni and accomplished through the ld script as @strnk shows</p> <pre><code>/DISCARD/ : { *(.eh_frame) *(.eh_frame_hdr) } </code></pre> <p>after the asserts.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload