Text Truncated
-
jrfritz
Text Truncated
If I set my -Ttext=0x10000 or over, LD truncates my external asm module that I linked with my C++ kernel...(I get a error message)
Why?/How can I fix this?
Why?/How can I fix this?
-
pskyboy
Re:Text Truncated
Thats odd, can i see the batch file, make file or commands you use for constructing your kernel image.
Peter
Peter
-
jrfritz
Re:Text Truncated
I use a linker script now...and I use Linux...I use SH files...not batch files...
Here:
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 : {
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
}
.data : {
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}
Also..I link my files like this:
nasm -f aout kernelasm.asm -o kernelasm.o
ld -T link.ld kernel32.o kernelasm.o -o tempbin -e 0x0
Here:
OUTPUT_FORMAT("binary")
ENTRY(start)
SECTIONS
{
.text 0x100000 : {
code = .; _code = .; __code = .;
*(.text)
. = ALIGN(4096);
}
.data : {
data = .; _data = .; __data = .;
*(.data)
. = ALIGN(4096);
}
.bss :
{
bss = .; _bss = .; __bss = .;
*(.bss)
. = ALIGN(4096);
}
end = .; _end = .; __end = .;
}
Also..I link my files like this:
nasm -f aout kernelasm.asm -o kernelasm.o
ld -T link.ld kernel32.o kernelasm.o -o tempbin -e 0x0
-
pskyboy
Re:Text Truncated
I don't know if this will solve the Truncation problem but you should remove the -e0x0 bit as this is set in your linker file as ENTRY(start). This bit should be a function exported from another ASM file like i have it as a stub i stick on to the front of my C Kernel.
Peter
Peter
-
jrfritz
Re:Text Truncated
This is what I found on google:
NASM won't mix 16- and 32-bit code in the same ELF or COFF
file. Use aout format instead (nasm -o foo.o -f aout foo.asm)
The DJGPP linker does understand aout format. If you do this,
no data object can be at an offset > 0xFFFF, or you will get
this linker error:
x.o(.text+0x13): relocation truncated to fit: 16 text
How do I make NASM create 32-bit NASM object code? ( My linker supports A.OUT )
NASM won't mix 16- and 32-bit code in the same ELF or COFF
file. Use aout format instead (nasm -o foo.o -f aout foo.asm)
The DJGPP linker does understand aout format. If you do this,
no data object can be at an offset > 0xFFFF, or you will get
this linker error:
x.o(.text+0x13): relocation truncated to fit: 16 text
How do I make NASM create 32-bit NASM object code? ( My linker supports A.OUT )
-
pskyboy
Re:Text Truncated
have you got 16bit and 32bit code in the same file if not as long as you have put.
[BITS 32]
It should assemble as 32bit code
Peter
[BITS 32]
It should assemble as 32bit code
Peter
-
pskyboy
Re:Text Truncated
Thats very odd it sounds like it should work to me. I do exactly the same output to aout format and tehn use thdjgpp linker
Peter
Peter
Re:Text Truncated
try setting -e to 0x100000 or to the start routine, etc. so if its your bootsector youd need uh -e 0x7c00 or whatever. or try -e start
-- Stu --
-
pskyboy
Re:Text Truncated
Here you go Tom have a look at this thread
http://www.mega-tokyo.com/forum/index.php?board=1;action=display;threadid=2233;start=0
http://www.mega-tokyo.com/forum/index.php?board=1;action=display;threadid=2233;start=0
