Jump to content

linker memory error


avockley
 Share

Recommended Posts

I'm having an issue when trying to compile my program. The full make log is included below. I think it is some kind of memory conflict, but I have no idea what it means, or how to solve it.

aarons-macbook-pro:Software aaron$ make

rm -rf _output/*

rm -rf _output

rm -rf *.cod *.map *.lst

rm -rf *.hex

mkdir -p _output

sh ~/svn/mios/trunk/bin/mios-gpasm -c -p p18f4685 -I./src -I ~/svn/mios/trunk/include/asm -I ~/svn/mios/trunk/include/share -I ~/svn/mios/trunk/modules/debug_msg -I ~/svn/mios/trunk/modules/app_lcd/dummy -DDEBUG_MODE=0  -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -I ~/svn/mios/trunk/modules/mios_wrapper /Users/aaron/svn/mios/trunk/modules/mios_wrapper/mios_wrapper.asm  -o _output/mios_wrapper.o

sh ~/svn/mios/trunk/bin/mios-gpasm -c -p p18f4685 -I./src -I ~/svn/mios/trunk/include/asm -I ~/svn/mios/trunk/include/share -I ~/svn/mios/trunk/modules/debug_msg -I ~/svn/mios/trunk/modules/app_lcd/dummy -DDEBUG_MODE=0   /Users/aaron/svn/mios/trunk/modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o

sh ~/svn/mios/trunk/bin/mios-sdcc -c -mpic16 -p18f4685 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2  -I./src -I ~/svn/mios/trunk/include/c -I ~/svn/mios/trunk/include/share -I ~/svn/mios/trunk/modules/debug_msg -DDEBUG_MODE=0  main.c -o _output/main.o

/Users/aaron/svn/mios/trunk/bin/mios-gpasm modifies _output/main.asm, result in _output/main__mios-gpasm-tmp.asm

sh ~/svn/mios/trunk/bin/mios-gpasm -c -p p18f4685 -I./src -I ~/svn/mios/trunk/include/asm -I ~/svn/mios/trunk/include/share -I ~/svn/mios/trunk/modules/debug_msg -I ~/svn/mios/trunk/modules/app_lcd/dummy -DDEBUG_MODE=0   /Users/aaron/svn/mios/trunk/modules/debug_msg/debug_msg.asm -o _output/debug_msg.o

gplink -s ~/svn/mios/trunk/etc/lkr/p18f4685.lkr -m -o project.hex  ~/svn/mios/trunk/lib/libsdcc.lib ~/svn/mios/trunk/lib/pic18f4685.lib _output/mios_wrapper.o _output/app_lcd.o _output/main.o _output/debug_msg.o

error: multiple sections using address 0x3280

make: *** [project.hex] Error 1

aarons-macbook-pro:Software aaron$

Any suggestions?

Link to comment
Share on other sites

  • 6 months later...

I get a similar error to this but at address 0:

rm -rf _output/*

rm -rf _output

rm -rf *.cod *.map *.lst

rm -rf *.hex

mkdir -p _output

/usr/local/bin/gpasm -c -p p18f452 -I./src -I /Users/user/Desktop/MIOS/include/asm -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -I /Users/user/Desktop/MIOS/modules/app_lcd/dummy -DDEBUG_MODE=0 -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE -I /Users/user/Desktop/MIOS/modules/mios_wrapper /Users/user/Desktop/MIOS/modules/mios_wrapper/mios_wrapper.asm -o _output/mios_wrapper.o

/usr/local/bin/gpasm -c -p p18f452 -I./src -I /Users/user/Desktop/MIOS/include/asm -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -I /Users/user/Desktop/MIOS/modules/app_lcd/dummy -DDEBUG_MODE=0 /Users/user/Desktop/MIOS/modules/app_lcd/dummy/app_lcd.asm -o _output/app_lcd.o

/usr/local/bin/sdcc -c -mpic16 -p18f452 --fommit-frame-pointer --optimize-goto --optimize-cmp --disable-warning 85 --obanksel=2 -I./src -I /Users/user/Desktop/MIOS/include/c -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -DDEBUG_MODE=0 main.c -o _output/main.o

/usr/local/bin/gpasm -c -p p18f452 -I./src -I /Users/user/Desktop/MIOS/include/asm -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -I /Users/user/Desktop/MIOS/modules/app_lcd/dummy -DDEBUG_MODE=0 /Users/user/Desktop/MIOS/modules/debug_msg/debug_msg.asm -o _output/debug_msg.o

gplink -s /Users/user/Desktop/MIOS/etc/lkr/p18f452.lkr -m -o project.hex /Users/user/Desktop/MIOS/lib/libsdcc.lib /Users/user/Desktop/MIOS/lib/pic18f452.lib _output/mios_wrapper.o _output/app_lcd.o _output/main.o _output/debug_msg.o

error: multiple sections using address 0

make: *** [project.hex] Error 1

Any thoughts, suggestions?

Link to comment
Share on other sites

Hi,

I'm using the base package from the bottom of the MIOS8 download page on ucApps. I've added all of these files to a new Xcode project as described here:

http://www.midibox.org/dokuwiki/doku.php?id=how_to_use_xcode2_as_ide_on_a_mac

I get a bit confused when it mentions the MAKEFILE.SPEC file as this isn't in the package. Nevertheless, I skipped over this part and went on to set up the application target, and also installed SDCC (version 2.6.0) and GPASM (version 0.13.4 beta) on usr/local/bin. I had to add paths to Makefile and common.mk to get them to compile, and these edited files are attached. Here is the shell script I used to initiate the build in Xcode:

export MIOS_PATH=~/Desktop/MIOS

PATH=/usr/local/bin:$PATH

chmod +x /usr/local/bin

cd $SRCROOT

make

exit 0

Makefile.rtf

common.rtf

Link to comment
Share on other sites

It doesn't matter where the directories are located.

/usr/local/bin is the traditional location, today we prefer /opt

It's important, that your PATH variable points to the appr. bin directories of the packages.

Best Regards, Thorsten.

Link to comment
Share on other sites

ok, so supposing I put those directories in a folder on my desktop called 'blob', would I have to edit the common.mk file like this:

# if MIOS_SHELL environment variable hasn't been set by the user, set it here

# Ubuntu users should set it to /bin/bash from external (-> "export MIOS_SHELL /bin/bash")

MIOS_SHELL ?= sh

export MIOS_SHELL=Users/user/Desktop/blob

# output directory

OUTDIR = _output

# add default libraries

LIBS += $(MIOS_PATH)/lib/libsdcc.lib $(MIOS_PATH)/lib/pic$(PROCESSOR).lib

# GPASM execution via wrapper

GPASM = $(MIOS_SHELL)/gputils-0.14.3/bin/gpasm -c

# SDCC execution via wrapper

SDCC = $(MIOS_SHELL)/sdcc-2.8.0/bin/sdcc -c

?

Do I then have to edit the shell script to this:

# shell script goes here

export MIOS_PATH=~/Desktop/MIOS

PATH=/Desktop/blob:$PATH

chmod +x /usr/local/bin

cd $SRCROOT

make

exit 0

?

As you may have guessed I'm a bit lost with all this at the moment, but thanks very much for your advice!

Link to comment
Share on other sites

There are some obsolete settings in your script...

Actually it should work this way:


# shell script goes here

# path to MIOS base directory
export MIOS_PATH=~/Desktop/MIOS

# path to MIOS bin directory
export MIOS_BIN_PATH=${MIOS_PATH}/bin

# path to SDCC and GPUTILS bin directories
export PATH=~/Desktop/blob/sdcc/bin:~/Desktop/blob/gputils/bin:$PATH

# change to SRCROOT (which is passed by Xcode?)
cd $SRCROOT

# execute the makefile
make
[/code]

Best Regards, Thorsten.

Link to comment
Share on other sites

Now I get a segmentation fault:

rm -rf _output/*

rm -rf _output

rm -rf *.cod *.map *.lst

rm -rf *.hex

mkdir -p _output

sh /Users/user/Desktop/MIOS/bin/mios-gpasm -c -p p18f452 -I./src -I /Users/user/Desktop/MIOS/include/asm -I /Users/user/Desktop/MIOS/include/share -I /Users/user/Desktop/MIOS/modules/debug_msg -I /Users/user/Desktop/MIOS/modules/app_lcd/dummy -DDEBUG_MODE=0 -DSTACK_HEAD=0x37f -DSTACK_IRQ_HEAD=0x33f -DDONT_INCLUDE_MIOS_ENC_TABLE -I /Users/user/Desktop/MIOS/modules/mios_wrapper /Users/user/Desktop/MIOS/modules/mios_wrapper/mios_wrapper.asm -o _output/mios_wrapper.o

/Users/user/Desktop/MIOS/bin/mios-gpasm: line 141: 274 Segmentation fault gpasm $ARGS

make: *** [_output/mios_wrapper.o] Error 139

Link to comment
Share on other sites

No, because the right versions are selected with highest priority in the PATH variable.

It could be, that this is related to a 32bit/64bit issue; Leopard is running in 32bit mode, right?

I need some time to find out how to compile for 32bit with the existing Xcode toolchain, because it seems that this isn't properly documented. :-/

Best Regards, Thorsten.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Loading...
 Share

×
×
  • Create New...