001 /* Copyright (C) 2005, David Decotigny
002
003 This program is free software; you can redistribute it and/or
004 modify it under the terms of the GNU General Public License
005 as published by the Free Software Foundation; either version 2
006 of the License, or (at your option) any later version.
007
008 This program is distributed in the hope that it will be useful,
009 but WITHOUT ANY WARRANTY; without even the implied warranty of
010 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
011 GNU General Public License for more details.
012
013 You should have received a copy of the GNU General Public License
014 along with this program; if not, write to the Free Software
015 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307,
016 USA.
017 */
018
019 /* We generate binary in the ELF format */
020 OUTPUT_FORMAT("elf32-i386","elf32-i386","elf32-i386");
021
022 /* The entry point of the program is _start (defined in crt.c) */
023 ENTRY(_start)
024
025 /* The architecture is i386 */
026 OUTPUT_ARCH("i386")
027
028 SECTIONS
029 {
030 /* our program is loaded at 2G */
031 . = 0x80000000;
032
033 /* Beginning of the text section */
034 .text :
035 {
036 /* This section includes the code */
037 *(.text*)
038 /* Defines the 'etext' and '_etext' at the end */
039 PROVIDE(etext = .);
040 PROVIDE(_etext = .);
041 }
042
043 /* Beginning of the data section */
044 .data . :
045 { *(.data*)
046 PROVIDE(edata = .);
047 PROVIDE(_edata = .);
048 }
049
050 /* Beginning of the read-only data section */
051 .rodata . :
052 { *(.rodata*)
053 *(.eh_frame*)
054 PROVIDE(erodata = .);
055 PROVIDE(_erodata = .);
056 }
057
058 /* Beginning of the BSS section (global uninitialized data) */
059 .bss SIZEOF(.rodata) + ADDR(.rodata) :
060 { PROVIDE(bbss = .);
061 PROVIDE(_bbss = .);
062 *(.bss)
063 *(COMMON)
064 PROVIDE(ebss = .);
065 PROVIDE(_ebss = .);
066 }
067 }