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