English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 26 November 2009, 23:03   #1
FrenchShark
FPGAmiga rulez!
 
FrenchShark's Avatar
 
Join Date: Dec 2007
Location: South of France
Age: 50
Posts: 155
m68k-amigaos-ld.exe bug ?

Hello,

I am trying to use AmiDevCpp to generate a boot ROM.
I am using vasmm68k for the assembly part and GCC for the C part.
I have a custom makefile and .ld file.

If I tell the linker to generate a binary for srec file, I have an ACCESS_VIOLATION.
If I generate an a.out file and use m68k-amigaos-objcopy.exe to create a binary, I have an empty binary file.

Makefile:
Code:
 
# Project: pff
# Compiler: m68k-Amiga-OS3
# Compiler Type: MingW 3
# Makefile created by wxDev-C++ 6.10.2 on 26/11/09 13:13
CPP       = m68k-amigaos-g++.exe
CC        = m68k-amigaos-gcc.exe
WINDRES   = windres.exe
OBJ       = main.o pff.o
LINKOBJ   = crt0.o main.o pff.o math.o access.o diskio.o sd.o
LIBS      = -T bootstrap.ld -Map bootstrap.map
INCS      = -I"D:/Perso/AmiDevCpp/usr/local/amiga/m68k-amigaos/sys-include"
CXXINCS   = -I"D:/Perso/AmiDevCpp/usr/local/amiga/m68k-amigaos/sys-include"
RCINCS    =
AOUT      = bootrom.aout
BIN       = bootrom.bin
DEFINES   =
CXXFLAGS  = $(CXXINCS) $(DEFINES) -save-temps -fexpensive-optimizations -O3 -m68000 -nostdlib -noixemul
CFLAGS    = $(INCS) $(DEFINES) -save-temps -fexpensive-optimizations -O3 -m68000 -nostdlib -noixemul
GPROF     = gprof.exe
RM        = rm -f
LINK      = m68k-amigaos-ld.exe
OBJCOPY   = m68k-amigaos-objcopy.exe
.PHONY: all all-before all-after clean clean-custom
all: all-before $(BIN) all-after
clean: clean-custom
 $(RM) $(OBJ) $(BIN) $(AOUT)
$(BIN): $(AOUT)
 $(OBJCOPY) -O binary $(AOUT) $(BIN)
$(AOUT): $(OBJ)
 $(LINK) $(LIBS)
main.o: $(GLOBALDEPS) main.c
 $(CC) -c main.c -o main.o $(CFLAGS)
pff.o: $(GLOBALDEPS) pff.c
 $(CC) -c pff.c -o pff.o $(CFLAGS)
.ld file:
Code:
 
TARGET(a.out-amiga)
INPUT(crt0.o main.o pff.o math.o access.o diskio.o sd.o)
OUTPUT(bootrom.aout)
MEMORY {
        bootram (RWX) : ORIGIN = 0x00000000, LENGTH = 0x00002000
        sdram   (RWX) : ORIGIN = 0x00002000, LENGTH = 0x00FFE000
}
SECTIONS {
        .text : {
                _stext = . ;
                crt0.o (.text)
                *(.text)
                _etext = . ;
        } > bootram
        .data : {
                _sdata = . ;
                *(.data)
                _edata = . ;
        } > sdram
        .bss : {
                _sbss = . ;
                *(.bss)
                *(COMMON)
                _ebss = . ;
        } > sdram
}
I am running out of ideas.

The only short term solution I see is to write everything in assembly.
FrenchShark is offline  
Old 28 November 2009, 00:00   #2
FrenchShark
FPGAmiga rulez!
 
FrenchShark's Avatar
 
Join Date: Dec 2007
Location: South of France
Age: 50
Posts: 155
I have found the solution :
vasm does not generate ".text" and ".data" sections but "code" and "data".
I found the problem by using the excellent vlink from Frank Wille.
His tool gives you more information than GNU ld in verbose mode
Now I am even thinking about dropping GCC and using VBCC.

Now, I have my boot ROM, it is time to run some 68000 code on the FPGA.

Cheers,

Frederic
FrenchShark is offline  
Old 30 November 2009, 09:54   #3
phx
Natteravn
 
phx's Avatar
 
Join Date: Nov 2009
Location: Herford / Germany
Posts: 2,500
Quote:
Originally Posted by FrenchShark View Post
I have found the solution :
vasm does not generate ".text" and ".data" sections but "code" and "data".
Just use the SECTION directive and give your sections the name you prefer. For example:
Code:
        section ".text",code
phx is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rewriting m68k code RobSis Coders. Tutorials 1 26 January 2013 16:15
AROS m68k Bug Reports Ezrec Amiga scene 1 03 October 2011 22:40
#M68k @ Amigaworld.net Iznougoud Amiga scene 0 06 October 2007 16:35
Shorten ported to AmigaOS m68k and WarpOS Paul News 0 20 August 2006 12:05
If WinUAE cannot detect your supposedly empty HDD, look for zap.exe or wipe.exe. fmcpma support.WinUAE 5 08 August 2006 00:35

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 14:14.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.06541 seconds with 13 queries