xref: /openbmc/linux/arch/x86/boot/setup.ld (revision 0a962f2f)
196ae6ea0SThomas Gleixner/*
296ae6ea0SThomas Gleixner * setup.ld
396ae6ea0SThomas Gleixner *
496ae6ea0SThomas Gleixner * Linker script for the i386 setup code
596ae6ea0SThomas Gleixner */
6e6d7bc0bSBorislav PetkovOUTPUT_FORMAT("elf32-i386")
796ae6ea0SThomas GleixnerOUTPUT_ARCH(i386)
896ae6ea0SThomas GleixnerENTRY(_start)
996ae6ea0SThomas Gleixner
1096ae6ea0SThomas GleixnerSECTIONS
1196ae6ea0SThomas Gleixner{
1296ae6ea0SThomas Gleixner	. = 0;
13d9b6b6e8SArd Biesheuvel	.bstext	: {
14d9b6b6e8SArd Biesheuvel		*(.bstext)
1509c205afSH. Peter Anvin		. = 495;
16d9b6b6e8SArd Biesheuvel	} =0xffffffff
17d9b6b6e8SArd Biesheuvel
1896ae6ea0SThomas Gleixner	.header		: { *(.header) }
197a734e7dSH. Peter Anvin	.entrytext	: { *(.entrytext) }
2096ae6ea0SThomas Gleixner	.inittext	: { *(.inittext) }
2196ae6ea0SThomas Gleixner	.initdata	: { *(.initdata) }
227a734e7dSH. Peter Anvin	__end_init = .;
237a734e7dSH. Peter Anvin
242e7a858bSArvind Sankar	.text		: { *(.text .text.*) }
25be721696SH. Peter Anvin	.text32		: { *(.text32) }
2696ae6ea0SThomas Gleixner
27*0a962f2fSArd Biesheuvel	.pecompat	: { *(.pecompat) }
28*0a962f2fSArd Biesheuvel	PROVIDE(pecompat_fsize = setup_size - pecompat_fstart);
29*0a962f2fSArd Biesheuvel
3096ae6ea0SThomas Gleixner	. = ALIGN(16);
3196ae6ea0SThomas Gleixner	.rodata		: { *(.rodata*) }
3296ae6ea0SThomas Gleixner
3396ae6ea0SThomas Gleixner	.videocards	: {
3496ae6ea0SThomas Gleixner		video_cards = .;
3596ae6ea0SThomas Gleixner		*(.videocards)
3696ae6ea0SThomas Gleixner		video_cards_end = .;
3796ae6ea0SThomas Gleixner	}
3896ae6ea0SThomas Gleixner
3996ae6ea0SThomas Gleixner	. = ALIGN(16);
4096ae6ea0SThomas Gleixner	.data		: { *(.data*) }
4196ae6ea0SThomas Gleixner
4296ae6ea0SThomas Gleixner	.signature	: {
4396ae6ea0SThomas Gleixner		setup_sig = .;
4496ae6ea0SThomas Gleixner		LONG(0x5a5aaa55)
45c731fbcfSArd Biesheuvel
46686b58ceSArd Biesheuvel		setup_size = ALIGN(ABSOLUTE(.), 4096);
47c731fbcfSArd Biesheuvel		setup_sects = ABSOLUTE(setup_size / 512);
4896ae6ea0SThomas Gleixner	}
4996ae6ea0SThomas Gleixner
5096ae6ea0SThomas Gleixner	. = ALIGN(16);
5196ae6ea0SThomas Gleixner	.bss		:
5296ae6ea0SThomas Gleixner	{
5396ae6ea0SThomas Gleixner		__bss_start = .;
5496ae6ea0SThomas Gleixner		*(.bss)
5596ae6ea0SThomas Gleixner		__bss_end = .;
5696ae6ea0SThomas Gleixner	}
5796ae6ea0SThomas Gleixner	. = ALIGN(16);
5896ae6ea0SThomas Gleixner	_end = .;
5996ae6ea0SThomas Gleixner
60163159aaSIlie Halip	/DISCARD/	: {
61163159aaSIlie Halip		*(.note*)
62163159aaSIlie Halip	}
6396ae6ea0SThomas Gleixner
64a5912f6bSIngo Molnar	/*
65a5912f6bSIngo Molnar	 * The ASSERT() sink to . is intentional, for binutils 2.14 compatibility:
66a5912f6bSIngo Molnar	 */
6796ae6ea0SThomas Gleixner	. = ASSERT(_end <= 0x8000, "Setup too big!");
6896ae6ea0SThomas Gleixner	. = ASSERT(hdr == 0x1f1, "The setup header has the wrong offset!");
697a734e7dSH. Peter Anvin	/* Necessary for the very-old-loader check to work... */
707a734e7dSH. Peter Anvin	. = ASSERT(__end_init <= 5*512, "init sections too big!");
717a734e7dSH. Peter Anvin
7296ae6ea0SThomas Gleixner}
73