Hi
I am very new to Microcontroller programming.
I am using Olimex board with AT91SAMX256 .
Does anyone have any idea where i can get Linker file and make files
with C++ support.
I am tyring seriously since few days to get rid off this error :
' No memory section defined for loadable section'.
I took some sample linker scripts with c++ support from WinArm projects
page but i dont know how to change memory locations according to my
target board or configure things to get started with c++ programming.
I tried almost all possibilities with different linker scripts.
The board works fine when i program with c.
But i must do my program now in c++.
So please help me out.
Have a nice day ahead.
Regards
Rajitha
Rajitha Dandu wrote:
> The board works fine when i program with c.>> But i must do my program now in c++.
If your program works in C, but not C++ theres also the possibility that
there is an error with your makefile. Post your entire make file,
linker script, and the entire output of the error you are getting.
>> make -k all> C:\Program: C:\Program: No such file or directory> make: *** [begin] Error 127> arm-elf-g++ (GCC) 4.1.1> Copyright (C) 2006 Free Software Foundation, Inc.> This is free software; see the source for copying conditions. There is> NO> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR> PURPOSE.>> C:\Program: C:\Program: No such file or directory> make: *** [Cstartup.o] Error 127> C:\Program: C:\Program: No such file or directory> make: *** [swi_handler.o] Error 127> C:\Program: C:\Program: No such file or directory> make: *** [finished] Error 127> C:\Program: C:\Program: No such file or directory> make: *** [end] Error 127> make: Target `all' not remade because of errors.>>> I dont understand from where the c:\program command comes from , i dont> see any such thing in makefile.>> I am trying to rectify this error since few days but nouse.>> Please help me>> Have a nice day ahead>> Regards> Rajitha
in your make file change
SHELL = sh
for
SHELL = cmd
what is you version of make.exe ?
you should use the 3.81 from the yagarto or openocd toolchain.
regards
Jonathan
Jonathan Dumarjo wrote:
>>>> make -k all>> C:\Program: C:\Program: No such file or directory>> make: *** [begin] Error 127>> arm-elf-g++ (GCC) 4.1.1>> Copyright (C) 2006 Free Software Foundation, Inc.>> This is free software; see the source for copying conditions. There is>> NO>> warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR>> PURPOSE.>>>> C:\Program: C:\Program: No such file or directory>> make: *** [Cstartup.o] Error 127>> C:\Program: C:\Program: No such file or directory>> make: *** [swi_handler.o] Error 127>> C:\Program: C:\Program: No such file or directory>> make: *** [finished] Error 127>> C:\Program: C:\Program: No such file or directory>> make: *** [end] Error 127>> make: Target `all' not remade because of errors.>>>>>> I dont understand from where the c:\program command comes from , i dont>> see any such thing in makefile.>>>> I am trying to rectify this error since few days but nouse.>>>> Please help me>>>> Have a nice day ahead>>>> Regards>> Rajitha>> in your make file change> SHELL = sh> for> SHELL = cmd>
what is you version of make.exe ?
>> you should use the 3.81 from the yagarto or openocd toolchain.>> regards>> Jonathan
Hi Thank you for your response.
I chaged to shell = cmd
and i have the make.exe from openocd and it is 3.81 .
Now the program gives error something like this:
Errors:
ld:cannot file -lnewlib-lpc
make: *** [sizebefore] error255
Warning:
c:\program
files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:AT91SAM7X256-ROM.ld
warning: memory region CODE not declared test_c++ line 57
1175092730506 788
Console shows:
make -k all
The system cannot find the path specified.
ECHO is off.
"-------- begin (mode: ROM_RUN) --------"
arm-elf-gcc (GCC) 4.1.1
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
-f was unexpected at this time.
make: *** [sizebefore] Error 255
ECHO is off.
Linking: main.elf
arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gdwarf-2
-DROM_RUN -DVECTORS_IN_RAM -D__WinARM__ -Os -ffunction-sections
-fdata-sections -Wall -Wcast-align -Wimplicit -Wpointer-arith -Wswitch
-Wredundant-decls -Wreturn-type -Wshadow -Wunused
-Wa,-adhlns=Cstartup.lst -MD -MP -MF .dep/main.elf.d Cstartup.o
swi_handler.o main.o --output main.elf -nostartfiles
-Wl,-Map=main.map,--cref,--gc-sections -lc -lnewlib-lpc -lm -lc -lgcc
-lstdc++ -TAT91SAM7X256-ROM.ld
c:\program
files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:AT91SAM7X256-ROM.ld:57:
warning: memory region CODE not declared
c:\program
files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:
cannot find -lnewlib-lpc
collect2: ld returned 1 exit status
make: *** [main.elf] Error 1
-f was unexpected at this time.
make: *** [sizeafter] Error 255
Errors: none
-------- end --------
ECHO is off.
make: Target `all' not remade because of errors.
Awaiting your response.
Have a nice evening ahead.
Regards
Rajitha
>> Hi Thank you for your response.>> I chaged to shell = cmd>> and i have the make.exe from openocd and it is 3.81 .>> Now the program gives error something like this:>> Errors:>> ld:cannot file -lnewlib-lpc> make: *** [sizebefore] error255>> Warning:> c:\program> files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:AT91SAM7X256-ROM.ld
> warning: memory region CODE not declared test_c++ line 57> 1175092730506 788>> Console shows:>> make -k all> The system cannot find the path specified.> ECHO is off.
I realy think that you have something wrong with your system path. do
you type this from command prompt ? if not, try it. sometime you have
some other output that can help you to find the path that dosen't work.
regards
Jonathan
>> ld:cannot file -lnewlib-lpc>> make: *** [sizebefore] error255>>
for the sizeof error, look in the make file, and remove the test to know
if a file exists, the -f xxxx, i don't know why but it dosen't work
anymore with shell = cmd.
regards
Jonathan
Jonathan Dumarjo wrote:
>>> ld:cannot file -lnewlib-lpc>>> make: *** [sizebefore] error255>>>>> for the sizeof error, look in the make file, and remove the test to know> if a file exists, the -f xxxx, i don't know why but it dosen't work> anymore with shell = cmd.>> regards>> Jonathan
Hi I am very thankful to you for your help so far.
I removed the -f xxx statements from makefile now there is no sizebefore
error but still the path not found error is there and also some other
errors are there.
I am using the files from sample projects of WinARM page ie., on this
page
http://www.siwawi.arubi.uni-kl.de/avr_projects/arm_projects/index_at91.html#at91_cpp
Do i need to change any linker scripts and assembler startup code .
I am using the linker scripts of AT91SAM7S256 , but i have the
AT91SAM7X256.
I checked the path in the command prompt everything is correct and i
also checked the path settings in the environment variables.
Please check this errors.
Errors:
undefined reference to `__FIRST_IN_RAM' test_c++ Cstartup.S line 342
1175177613674 865
undefined reference to `AT91F_LowLevelInit' test_c++ Cstartup.S line
342 1175177613674 866
undefined reference to `SWI_Handler_User' test_c++ swi_handler.S line
148 1175177613674 867
Warnings:
c:\program
files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:AT91SAM7X256-ROM.ld
warning: memory region CODE not declared test_c++ line 57
1175177613674 864
Console shows:
make -k all
The system cannot find the path specified.
ECHO is off.
"-------- begin (mode: ROM_RUN) --------"
arm-elf-gcc (GCC) 4.1.1
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
ECHO is off.
Linking: main.elf
arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gdwarf-2
-DROM_RUN -DVECTORS_IN_RAM -D__WinARM__ -Os -ffunction-sections
-fdata-sections -Wall -Wcast-align -Wimplicit -Wpointer-arith -Wswitch
-Wredundant-decls -Wreturn-type -Wshadow -Wunused
-Wa,-adhlns=Cstartup.lst -MD -MP -MF .dep/main.elf.d Cstartup.o
swi_handler.o main.o --output main.elf -nostartfiles
-Wl,-Map=main.map,--cref,--gc-sections -lc -lc -lgcc -lstdc++
-TAT91SAM7X256-ROM.ld
c:\program
files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:AT91SAM7X256-ROM.ld:57:
warning: memory region CODE not declared
Cstartup.o: In function `exit':
C:\EclipseWorkspace\test_c++/Cstartup.S:342: undefined reference to
`__FIRST_IN_RAM'
C:\EclipseWorkspace\test_c++/Cstartup.S:342: undefined reference to
`AT91F_LowLevelInit'
swi_handler.o: In function `EndofSWI':
C:\EclipseWorkspace\test_c++/swi_handler.S:148: undefined reference to
`SWI_Handler_User'
collect2: ld returned 1 exit status
make: *** [main.elf] Error 1
Errors: none
-------- end --------
ECHO is off.
make: Target `all' not remade because of errors.
I am using this Yagarto Eclipse IDE for my thesis and right now i am
stuck up here since two weeks , and the time is running off, i need to
do programming only in c++ and i dont understand what to do at this
stage.
Awaiting your response.
Reagards
Rajitha
Jonathan Dumarjo wrote:
>>> ld:cannot file -lnewlib-lpc>>> make: *** [sizebefore] error255>>>>> for the sizeof error, look in the make file, and remove the test to know> if a file exists, the -f xxxx, i don't know why but it dosen't work> anymore with shell = cmd.>> regards>> Jonathan
Hi
Now i have the following errors.
I think there is some problem with the Linker script memory regions and
ld.exe .
Please see this error:
Errors:
ld: internal error ../../binutils-2.17/ld/ldlang.c 4275 test_c++
line 0 1175180093750 880
Warnings:
c:\program
files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:AT91SAM7X256-ROM.ld
warning: memory region CODE not declared test_c++ line 57
1175180093750 879
Console shows:
make -k all
The system cannot find the path specified.
ECHO is off.
"-------- begin (mode: ROM_RUN) --------"
arm-elf-gcc (GCC) 4.1.1
Copyright (C) 2006 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is
NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR
PURPOSE.
ECHO is off.
Linking: main.elf
arm-elf-gcc -mthumb -mcpu=arm7tdmi -mthumb-interwork -I. -gdwarf-2
-DROM_RUN -DVECTORS_IN_RAM -D__WinARM__ -Os -ffunction-sections
-fdata-sections -Wall -Wcast-align -Wimplicit -Wpointer-arith -Wswitch
-Wredundant-decls -Wreturn-type -Wshadow -Wunused -Wa,-adhlns=crt.lst
-MD -MP -MF .dep/main.elf.d crt.o main.o --output main.elf
-nostartfiles -Wl,-Map=main.map,--cref,--gc-sections -lc -lc -lgcc
-lstdc++ -TAT91SAM7X256-ROM.ld
c:\program
files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:AT91SAM7X256-ROM.ld:57:
warning: memory region CODE not declared
c:\program
files\yagarto\bin\..\lib\gcc\arm-elf\4.1.1\..\..\..\..\arm-elf\bin\ld.ex
e:
internal error ../../binutils-2.17/ld/ldlang.c 4275
collect2: ld returned 1 exit status
make: *** [main.elf] Error 1
Errors: none
-------- end --------
ECHO is off.
make: Target `all' not remade because of errors.
Please reply.
Regards
Rajitha
Hi,
Ok have the sample compile here on my setup for a sam7x256. If you want
it, send
me an e-mail. I have not tested the program, i have just change the make
file and add a ld script for the 7x256.
jdumaresq @ cimeq.qc.ca
regards
Jonathan
Jonathan Dumarjo wrote:
> Hi,>> Ok have the sample compile here on my setup for a sam7x256. If you want> it, send> me an e-mail. I have not tested the program, i have just change the make> file and add a ld script for the 7x256.>> jdumaresq @ cimeq.qc.ca>> regards>> Jonathan
Hi
I am thankful to you for your intime response.
I like to have the makefiles and linker scripts with c++ support for
AT91SAM7X256.
I will be very thankful to you if you can provide me those.
Is this your email address : jdumaresq @ cimeq.qc.ca
I cant send any email to this adddress. It says invalid
Have a nice day ahead.
Regards
Rajitha
> Hi>> I am thankful to you for your intime response.>> I like to have the makefiles and linker scripts with c++ support for> AT91SAM7X256.>> I will be very thankful to you if you can provide me those.>> Is this your email address : jdumaresq @ cimeq.qc.ca>> I cant send any email to this adddress. It says invalid>> Have a nice day ahead.>> Regards> Rajitha
remove the space between @ :P
Jonathan
Jonathan Dumaresq wrote:
>> Hi>>>> I am thankful to you for your intime response.>>>> I like to have the makefiles and linker scripts with c++ support for>> AT91SAM7X256.>>>> I will be very thankful to you if you can provide me those.>>>> Is this your email address : jdumaresq @ cimeq.qc.ca>>>> I cant send any email to this adddress. It says invalid>>>> Have a nice day ahead.>>>> Regards>> Rajitha>> remove the space between @ :P>> Jonathan
Hi
The errors have been corrected now.
Thank you Jonathan for your support to solve this problem . It was
really a great help to me.
The problem was with the makefile and liker file.
In linker file we need to have memory region defined correctly for the
specific target we are using for differenrent regions.
There were some more errors and warnings like :
atal error: opening dependency file .dep/Cstartup_SAM7.o.d: No such file
or directory test_sam7x_c++/common Cstartup_SAM7.c line 86 1175273573862
1078
fatal error: opening dependency file .dep/dbgu.o.d: No such file or
directory test_sam7x_c++ dbgu.c line 115 1175273573878 1081
fatal error: opening dependency file .dep/main.o.d: No such file or
directory test_sam7x_c++ main.cpp line 233 1175273573878 1084
fatal error: opening dependency file .dep/swi_handler_user.o.d: No such
file or directory test_sam7x_c++ swi_handler_user.c line 17
1175273573878 1083
fatal error: opening dependency file .dep/syscalls.o.d: No such file or
directory test_sam7x_c++ syscalls.c line 159 1175273573878 1082
warning: implicit declaration of function 'siscanf' test_sam7x_c++
dbgu.c line 113 1175273573878 1079
warning: nested extern declaration of 'siscanf' test_sam7x_c++ dbgu.c
line 113 1175273573878 1080
Then i created a dep directory in the location where i strore my program
in the eclipse workspace
C:\EclipseWorkspace\test_sam7x_c++\dep
and changed the line in makefile
GENDEPFLAGS = -MD -MP -MF .dep/$(@F).d
for
GENDEPFLAGS = -MD -MP -MF dep/$(@F).d
For the warning : There was missing declaration for that function in
dgu.c
So i declared that function sisscanf , actually it was commented before
so i removed the comment.
Now everything works fine.
One more i like to suggest is building from command prompt is always a
good idea when we have errors as we can see more errors as suggested by
my friend Jonathan as well.
I got one more error when was coipling using simple c++ programs after
buiding the project like
ld: internal error ../../binutils-2.17/ld/ldlang.c 4275 test_c++ line 0
1175273524248 1077
But when i declared a constructor for a class then it got rectified.
I dont know many things about these files i am very new to arm
microcontroller programming but hope this message helps someone like me.
Regards
Rajitha
> Hi>> The errors have been corrected now.>> Thank you Jonathan for your support to solve this problem . It was> really a great help to me.>>> I dont know many things about these files i am very new to arm> microcontroller programming but hope this message helps someone like me.>> Regards> Rajitha
Good luck with your project now !
Jonathan
hello:
error from ldlang.c line 4275 is a known issue and has been fixed in
the latest binutils. GNUARM 4.1.1 has this error. Pablo Bleyer Kocik
has been informed. pls see Sourceware BugZilla bug reports for 6726
and 6727 for updates on the issue.
a detailed summary is provided below.
Flying Arm wrote:
> I think there is some problem with the Linker script memory regions and> ld.exe .>> Please see this error:>> Errors:>> ld: internal error ../../binutils-2.17/ld/ldlang.c 4275 test_c++> line 0 1175180093750 880
i have found 2 problems with the current GNUARM distribution, which Nick
Clifton has said are due to errors in binutils that have already been
fixed in
the latest version.
2 bugs have been filed with GCC and reports have been filed with
Comp.Arch.Embedded and Mikrocontroller.net Forum.
the problem was reproduced using simple, sample code and details have
been
added into the Sourceware BugZilla bug reports.
the information below is for your reference. kindly let me know if you
need any
more information.
pls see these links for more information:
- GCC Bugzilla Bug 6726
http://sourceware.org/bugzilla/show_bug.cgi?id=6726
- GCC Bugzilla Bug 6727
http://sourceware.org/bugzilla/show_bug.cgi?id=6727
- Mikrocontroller.net Forum
http://en.mikrocontroller.net/topic/158791#699646
- Comp.Arch.Embedded
http://www.embeddedrelated.com/usenet/embedded/show/96927-1.php
GLOBAL CONDITIONS
if:
- you enable --gc-sections
- you enable Thumb Interworking
PROBLEM 1
- if you do not define program entry point: you get the ldlang.c 4275
error
SOLUTION 1
- simply define entry point _start or whatever using --entry if required
PROBLEM
- you position another section using --section-start before .text using
-Ttext:
you get ZERO interworking code
SOLUTION
- position .data/other section AFTER .text. place -Ttext before
--section-start
or -Tdata.
i hope that this is helpful to you.
Aaron
--
{tel: +91-20-6526-7076; cell: +91-9970-591-079; fax: +1-800-450-5419}