GCC arguments

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
pini

GCC arguments

Post by pini »

Please, if you are using gcc to compile your kernel, could you give me the command-line arguments you're using ?
Whatever5k

Re:GCC arguments

Post by Whatever5k »

I'm using a linker script...

Code: Select all

OUTPUT_FORMAT("elf32-i386")     /* we use ELF */
ENTRY(start)

physical_load_addr = 0x100000;  /* GRUB can't load below 1MB */
SECTIONS
{
    . = physical_load_addr;
    .text :
    {
        *(.text)
    }
    .rodata :
    {
        *(.rodata)      /* need this! */
    }
    .data :
    {
        *(.data)
    }
    .bss :
    {
        bss = .;
        *(COMMON)
        *(.bss)
    }
    end = .;
}
When linking, I use the "ld -T linker.ld ..."...
For gcc, it's just "gcc -c file.c"
Post Reply