Code: Select all
setup_32.s:119:(.text+0x85): relocation truncated to fit: R_386_16 against `.text'
Code: Select all
setup_32.s:119:(.text+0x85): relocation truncated to fit: R_386_16 against `.text'
Code: Select all
ENTRY(_start)
SECTIONS
{
/* Begin putting sections here */
. = 0x100000;
/* First put the multiboot header followed by .text section. */
.text BLOCK(4K) : ALIGN(4K)
{
*(.multiboot)
*(.text)
}
/* Read-only data. */
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata)
}
/* Read-write data (initialized) */
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
}
/* Read-write data (uninitialized) and stack */
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
}
/* Put other sections the compiler generates here */
}
Code: Select all
(gdb) info reg
eax 0x2badb002 732803074
ecx 0x0 0
edx 0x0 0
ebx 0x10000 65536
esp 0x7ff00 0x7ff00
ebp 0x0 0x0
esi 0x0 0
edi 0x0 0
eip 0x101b66 0x101b66 <_start>
eflags 0x200046 [ PF ZF ID ]
cs 0x10 16
ss 0x18 24
ds 0x18 24
es 0x18 24
fs 0x18 24
gs 0x18 24
(gdb) x/128x 0x00
0x0: 0xf000ff53 0xf000ff53 0xf000e2c3 0xf000ff53
0x10: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x20: 0xf000fea5 0xf000e987 0xf000d676 0xf000d676
0x30: 0xf000d676 0xf000d676 0xf000ef57 0xf000d676
0x40: 0xc0004d65 0xf000f84d 0xf000f841 0xf000e3fe
0x50: 0xf000e739 0xf000f859 0xf000e82e 0xf000efd2
0x60: 0xf000d69b 0xf000e6f2 0xf000fe6e 0xf000ff53
0x70: 0xf000ff53 0xf000ff53 0xf00068e4 0xc00084a8
0x80: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x90: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0xa0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0xb0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0xc0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0xd0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0xe0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0xf0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x100: 0xf000ec59 0x9fc0003d 0xf000ff53 0xc00062a8
0x110: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x120: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x130: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x140: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x150: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x160: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x170: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x180: 0x00000000 0x00000000 0x00000000 0x00000000
0x190: 0x00000000 0x00000000 0x00000000 0xf000ff53
0x1a0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x1b0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
0x1c0: 0xf000d65b 0xf000d67f 0xf000d67f 0xf000d67f
0x1d0: 0xf000d664 0xf000d66d 0xf000d652 0xf000d67f
0x1e0: 0xf000ff53 0x00000000 0xf000ff53 0xf000ff53
0x1f0: 0xf000ff53 0xf000ff53 0xf000ff53 0xf000ff53
Code: Select all
OUTPUT_FORMAT("elf32-i386")
ENTRY(_start)
PHYSICAL_BASE_ADDRESS = 0x00100000;
REAL_BASE_ADDRESS = 0x1000;
SECTIONS
{
/* Set the counter to 0x100000 */
. = PHYSICAL_BASE_ADDRESS;
/* Find the distance between 0x100000 - 0x1000 => 0xff000 */
__physreal_diff = . - REAL_BASE_ADDRESS;
/* Tell the linker that the .realmode section should have virtual addresses */
/* generated at 0x1000, but is loaded at 0x100000 */
.realmode REAL_BASE_ADDRESS : AT(ADDR(.realmode) + __physreal_diff) {
__realmode_vma_start = .;
/* LOADADDR is the LMA of the specified section */
__realmode_lma_start = LOADADDR(.realmode);
*(.text.realmode);
*(.data.realmode);
*(.multiboot);
}
/* Align at 4 Bytes and define some new symbols in our image we can refernce */
. = ALIGN(4);
__realmode_vma_end = .;
__realmode_secsize = ((__realmode_vma_end)-(__realmode_vma_start));
/* Set virtual address counter to 0x100000 */
. += __physreal_diff;
.text ALIGN(4K) : AT(ADDR(.text))
{
*(.text);
}
/* Read-only data. */
.rodata BLOCK(4K) : ALIGN(4K)
{
*(.rodata)
}
/* Read-write data (initialized) */
.data BLOCK(4K) : ALIGN(4K)
{
*(.data)
}
/* Read-write data (uninitialized) and stack */
.bss BLOCK(4K) : ALIGN(4K)
{
*(COMMON)
*(.bss)
}
/* Put other sections the compiler generates here */
}