troubleshooting Question

manually assembling and linking gcc ouput source files

Avatar of sean-keys
sean-keys asked on
Linux OS DevC
14 Comments7 Solutions718 ViewsLast Modified:
I have gcc creating asm source files like this.

m68hc11-gcc -g -Wall -Werror -Winline -O -m68hcs12 -mshort -ffunction-sections -fomit-frame-pointer -msoft-reg-count=8 -mauto-incdec -fsigned-char -x cpp-output -S -o assembly/main.s preprocessedc/main.pp.c

from that output I can manually assemble it like this

m68hc11-as main.s -o main.o -m68hcs12

 or like this

m68hc11-gcc -g -Wall -Werror -Winline -O -m68hcs12 -mshort -ffunction-sections -fomit-frame-pointer -msoft-reg-count=8 -mauto-incdec -fsigned-char -c -o objects/freeEMS.o assembly/freeEMS.s
and it wont give me any errors

but when I try to link, I get this.
m68hc12-ld -defsym vectors_addr=0xF710 -m m68hc12elfb -T hc9s12xdp512elfb.x -o output/freeems-0.1.1-SNAPSHOT-Simple.elf objects/Simple.o objects/freeEMS.o objects/staticInit.o objects/main.o objects/tableLookup.o objects/init.o objects/utils.o objects/globalConstants.o objects/coreVarsGenerator.o objects/derivedVarsGenerator.o objects/fuelAndIgnitionCalcs.o objects/flashWrite.o objects/commsCore.o objects/blockDetailsLookup.o objects/interrupts.o objects/injectionISRs.o objects/ignitionISRs.o objects/commsISRs.o objects/realtimeISRs.o objects/miscISRs.o objects/FixedConfig1.o objects/FixedConfig2.o objects/IATTransferTable.o objects/CHTTransferTable.o objects/MAFTransferTable.o objects/TestTransferTable.o objects/FuelTables.o objects/FuelTables2.o objects/TimingTables.o objects/TimingTables2.o objects/TunableConfig.o objects/TunableConfig2.o objects/flashBurn.o
/usr/bin/m68hc11-ld: warning: cannot find entry symbol _start; defaulting to 0000c000
objects/Simple.o: In function `PrimaryRPMISR':
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.tmp'
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.z'
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.xy'
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.d1'
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.d2'
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.d3'
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.d4'
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.d5'
/home/fred/workspaces/home/freeems-vanilla/src/Simple.c:69: undefined reference to `_.d6'
and the list goes on

I can link from gcc, but I need to use an external linker that has special patches.

I'm not quite sure where I am going wrong.  Any input would be appreciated.
Join the community to see this answer!
Join our exclusive community to see this answer & millions of others.
Unlock 7 Answers and 14 Comments.
Join the Community
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 7 Answers and 14 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros