problem building x64 executable [solved]
Posted: Wed Sep 26, 2007 6:33 am
hi all,
When using the linkerscript posted below i get the folowing error messages:
Can somebody explian to me why this is and how to solve it. I don't want to have position independant code for every executable.
i have build a cross compiler btw.
os64dev
When using the linkerscript posted below i get the folowing error messages:
If i compile with the -fPIC compiler flag everything works. My question:obj/core/core.co: In function `crt::main()':
core.cc:(.text+0x115): relocation truncated to fit: R_X86_64_32 against `.rodata
.str1.1'
lib/libc.lib(printf.co): In function `printf(char const*, ...)':
printf.cc:(.text+0x534): relocation truncated to fit: R_X86_64_32 against `.text
Can somebody explian to me why this is and how to solve it. I don't want to have position independant code for every executable.
i have build a cross compiler btw.
os64dev
Code: Select all
OUTPUT_FORMAT("elf64-x86-64", "elf64-x86-64", "elf64-x86-64")
ENTRY (_ZN3crt4mainEv)
SECTIONS
{
. = 0xFFFFFFFFC0000000;
code_base = .;
.text :
{ *(.text*);
}
code_end = .;
. = ALIGN (0x1000); /* align on a 4 KiB page */
rodata_base = .;
.rodata :
{ *(.rdata*);
*(.rodata*);
ctors_base = ALIGN (0x08);
*(.ctors*);
ctors_end = ALIGN (0x08);
dtors_base = ALIGN (0x08);
*(.dtors*);
dtors_end = ALIGN (0x08);
}
rodata_end = .;
. = ALIGN (0x1000); /* align on a 4 KiB page */
rwinit_base = .;
.rwinit :
{ *(.data*);
*(.rwdata*);
}
rwinit_end = .;
rwdata_base = .;
.rwdata :
{ bss_base = ALIGN (0x08);
*(.bss*);
bss_end = ALIGN (0x08);
*(COMMON*);
}
rwdata_end = ALIGN (0x10); /* align on a realmode segment boundry */
/DISCARD/ : { *(.comment .note .eh_frame .symtab) }
}