Re: [uClinux-dev] elf2flt error with ARM Cortex-R4 toolchain
Thanks a lot for ur help. It works !! Regards Pankaj -Original Message- From: uclinux-dev-boun...@uclinux.org [mailto:uclinux-dev-boun...@uclinux.org] On Behalf Of Marcelo Salazar Sent: Wednesday, August 01, 2012 9:19 PM To: uclinux-dev@uclinux.org Subject: [uClinux-dev] elf2flt error with ARM Cortex-R4 toolchain Hello all, I've successfully built a complex application for the Cortex-R4 by using the CodeSourcery toolchain. After googling for a while, I found this link: http://www.codesourcery.com/sgpp/lite/arm/portal/package6503/public/arm-uclinuxeabi/arm-2010q1-189-arm-uclinuxeabi-i686-pc-linux-gnu.tar.bz2 Hope this helps. Regards. Marcelo Jivin Pankaj DEV lays it down ... Hey, I downloaded latest sources for elf2flt from http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/elf2flt/ But they are exactly the same as from blackfin. but there are working ARM toolchains out there with elf2flt included Could you provide me any link/pointer for any ARM-CortexR4 toolchain with elf2flt included ? Codesourcery traditionally did this quite well. They have since been bought by Mentor and I have no experience with them myself: http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ Maybe do some googling ;-) Cheers, Davidm ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt error with ARM Cortex-R4 toolchain
Jivin Pankaj DEV lays it down ... Hey, I downloaded latest sources for elf2flt from http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/elf2flt/ But they are exactly the same as from blackfin. but there are working ARM toolchains out there with elf2flt included Could you provide me any link/pointer for any ARM-CortexR4 toolchain with elf2flt included ? Codesourcery traditionally did this quite well. They have since been bought by Mentor and I have no experience with them myself: http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/editions/lite-edition/ Maybe do some googling ;-) Cheers, Davidm -Original Message- From: David McCullough [mailto:david_mccullo...@mcafee.com] Sent: Friday, July 20, 2012 10:23 AM To: Pankaj DEV Cc: uclinux-dev@uclinux.org Subject: Re: elf2flt error with ARM Cortex-R4 toolchain Jivin Pankaj DEV lays it down ... Hello, I am using ARM-Versatile Cortex-R4 platform and I have toolchain build with following components? versions : 1. GNU GCC : 4.6.3 20120301 2. GNU Binutils - 2.20.51.20100809 3. uClibc-nptl-0.9.33-66 To build the user application binary (FLAT), I downloaded the following(latest) version of ELF2FLT package from http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=summary 2011-04-04 David McCullough http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=search; s=David+McCullough;st=author The GNU linker uses -v as a shortcut to --version,... http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=commit; h=40f0d175e0847d922faa85cc18ec01f2129bb2b9 My only question is why you are using the blackfin version of elf2flt for an ARM system ? It may be fine, I don't really know, but its primary purpose would be blackfind support I suspect ;-) I haven't played with elf2flt for a long time, but there are working ARM toolchains out there with elf2flt included. Build your ARM tool chain, then try this version of elf2flt: http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/elf2flt/ Otherwise, hopefully someone on the list is currently using something and can help you, Cheers, Davidm I was able to build the package properly and install it in my existing (above) toolchain, but now when I try to build a simple (hello) C user program using ?Wl,-elf2flt options, I am getting following errors : a. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: section .junk loaded at [,001f] overlaps section .text loaded at [,011f] b. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: BFD (GNU Binutils - STMicroelectronics/Linux Base) 2.20.51.20100809 assertion fail ../../bfd/elf32-arm.c:13377 Any Idea ? My doubt : Is ELF2FLT package compatible with the above mentioned versions of GCC/Binutils/uClibc for ARM-R4 used ? If anybody has tried to build a toolchain for ARM with this ELF2FLT package, can u help us with the versions of GCC/Binutils/uClibc ? Or may be if anyone knows any working ARM-CortexR4 working toolchain containing ELF2FLT ? Regards Pankaj Dev -- David McCullough, david_mccullo...@mcafee.com, Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org -- David McCullough, david_mccullo...@mcafee.com, Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt error with ARM Cortex-R4 toolchain
Hi Pankaj, On 07/20/2012 05:21 PM, Pankaj DEV wrote: I downloaded latest sources for elf2flt from http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/elf2flt/ But they are exactly the same as from blackfin. but there are working ARM toolchains out there with elf2flt included Could you provide me any link/pointer for any ARM-CortexR4 toolchain with elf2flt included ? Try the code sourcery tool chains. They usually work pretty well. Regards Greg -Original Message- From: David McCullough [mailto:david_mccullo...@mcafee.com] Sent: Friday, July 20, 2012 10:23 AM To: Pankaj DEV Cc: uclinux-dev@uclinux.org Subject: Re: elf2flt error with ARM Cortex-R4 toolchain Jivin Pankaj DEV lays it down ... Hello, I am using ARM-Versatile Cortex-R4 platform and I have toolchain build with following components? versions : 1. GNU GCC : 4.6.3 20120301 2. GNU Binutils - 2.20.51.20100809 3. uClibc-nptl-0.9.33-66 To build the user application binary (FLAT), I downloaded the following(latest) version of ELF2FLT package from http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=summary 2011-04-04 David McCullough http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=search; s=David+McCullough;st=author The GNU linker uses -v as a shortcut to --version,... http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=commit; h=40f0d175e0847d922faa85cc18ec01f2129bb2b9 My only question is why you are using the blackfin version of elf2flt for an ARM system ? It may be fine, I don't really know, but its primary purpose would be blackfind support I suspect ;-) I haven't played with elf2flt for a long time, but there are working ARM toolchains out there with elf2flt included. Build your ARM tool chain, then try this version of elf2flt: http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/elf2flt/ Otherwise, hopefully someone on the list is currently using something and can help you, Cheers, Davidm I was able to build the package properly and install it in my existing (above) toolchain, but now when I try to build a simple (hello) C user program using ?Wl,-elf2flt options, I am getting following errors : a. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: section .junk loaded at [,001f] overlaps section .text loaded at [,011f] b. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: BFD (GNU Binutils - STMicroelectronics/Linux Base) 2.20.51.20100809 assertion fail ../../bfd/elf32-arm.c:13377 Any Idea ? My doubt : Is ELF2FLT package compatible with the above mentioned versions of GCC/Binutils/uClibc for ARM-R4 used ? If anybody has tried to build a toolchain for ARM with this ELF2FLT package, can u help us with the versions of GCC/Binutils/uClibc ? Or may be if anyone knows any working ARM-CortexR4 working toolchain containing ELF2FLT ? Regards Pankaj Dev -- Greg Ungerer -- Principal EngineerEMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close,FAX: +61 7 3891 3630 Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt error with ARM Cortex-R4 toolchain
Hello Pankaj I've successfully built a toolchain for an arm926ejs that allow me to build an simple c hello world (i haven't tested multithread, c++, or complex project with lot of dependancies, ...) I used the git://sources.blackfin.uclinux.org/git/users/vapier/elf2flt.git sources with the attached patch. The script used for compiling the toolchain is https://gitorious.org/bif/bif/blobs/master/framework/packages/toolchain-uclinux_uclibc/toolchain-uclinux_uclibc.sh It's a personal job that should not be taken as a reference... and perhaps you could also see the sources of busybox, crosstools-ng or openembedded ... Regards. Paul. Le 07/20/2012 05:43 AM, Pankaj DEV a écrit : Hello, I am using ARM-Versatile Cortex-R4 platform and I have toolchain build with following components' versions : 1. GNU GCC : 4.6.3 20120301 2. GNU Binutils - 2.20.51.20100809 3. uClibc-nptl-0.9.33-66 To build the user application binary (FLAT), I downloaded the following(latest) version of ELF2FLT package from http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=summary 2011-04-04 David McCulloughhttp://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=search;s=David+McCullough;st=author The GNU linker uses -v as a shortcut to --version,... http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=commit;h=40f0d175e0847d922faa85cc18ec01f2129bb2b9 I was able to build the package properly and install it in my existing (above) toolchain, but now when I try to build a simple (hello) C user program using -Wl,-elf2flt options, I am getting following errors : a. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: section .junk loaded at [,001f] overlaps section .text loaded at [,011f] b. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: BFD (GNU Binutils - STMicroelectronics/Linux Base) 2.20.51.20100809 assertion fail ../../bfd/elf32-arm.c:13377 Any Idea ? My doubt : Is ELF2FLT package compatible with the above mentioned versions of GCC/Binutils/uClibc for ARM-R4 used ? If anybody has tried to build a toolchain for ARM with this ELF2FLT package, can u help us with the versions of GCC/Binutils/uClibc ? Or may be if anyone knows any working ARM-CortexR4 working toolchain containing ELF2FLT ? Regards Pankaj Dev ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev From eca469f6946f92035f1ba4463829eb1f0e0fd98d Mon Sep 17 00:00:00 2001 From: Paul Chavent paul.chav...@fnac.net Date: Thu, 17 May 2012 08:10:44 +0200 Subject: [PATCH] Arm support update (exidx sections). --- .gitignore|1 + elf2flt.c | 27 +++ elf2flt.ld.in | 17 ++--- 3 files changed, 42 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 92ff5f6..e0e0bd5 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ elf2flt elf2flt.ld flthdr ld-elf2flt +ld-elf2flt.sh \ No newline at end of file diff --git a/elf2flt.c b/elf2flt.c index 2fea9b5..1a7ef88 100644 --- a/elf2flt.c +++ b/elf2flt.c @@ -54,6 +54,8 @@ const char *elf2flt_progname; #if defined(TARGET_h8300) #include elf/h8.h /* TARGET_* ELF support for the BFD library */ +#elif defined(TARGET_arm) +#include elf/arm.h #elif defined(__CYGWIN__) || defined(__MINGW32__) || defined(TARGET_nios) || defined(TARGET_nios2) #include cygwin-elf.h/* Cygwin uses a local copy */ #elif defined(TARGET_microblaze) @@ -639,12 +641,16 @@ dump_symbols(symbols, number_of_symbols); relocation_needed = 1; break; case R_ARM_REL32: + case R_ARM_JUMP24: + case R_ARM_CALL: case R_ARM_THM_PC11: case R_ARM_THM_PC22: case R_ARM_PC24: case R_ARM_PLT32: case R_ARM_GOTPC: case R_ARM_GOT32: + case R_ARM_PREL31: + case R_ARM_NONE: relocation_needed = 0; break; default: @@ -1702,6 +1708,27 @@ int main(int argc, char *argv[]) } } + if (verbose) { +printf( verbose = %d\n + load_to_ram = %d\n + ktrace = %d\n + docompress = %d\n + pfile= \%s\\n + ofile= \%s\\n + use_resolved = %d\n +
Re: [uClinux-dev] elf2flt error with ARM Cortex-R4 toolchain
Hey, I downloaded latest sources for elf2flt from http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/elf2flt/ But they are exactly the same as from blackfin. but there are working ARM toolchains out there with elf2flt included Could you provide me any link/pointer for any ARM-CortexR4 toolchain with elf2flt included ? Thanks Pankaj Dev -Original Message- From: David McCullough [mailto:david_mccullo...@mcafee.com] Sent: Friday, July 20, 2012 10:23 AM To: Pankaj DEV Cc: uclinux-dev@uclinux.org Subject: Re: elf2flt error with ARM Cortex-R4 toolchain Jivin Pankaj DEV lays it down ... Hello, I am using ARM-Versatile Cortex-R4 platform and I have toolchain build with following components? versions : 1. GNU GCC : 4.6.3 20120301 2. GNU Binutils - 2.20.51.20100809 3. uClibc-nptl-0.9.33-66 To build the user application binary (FLAT), I downloaded the following(latest) version of ELF2FLT package from http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=summary 2011-04-04 David McCullough http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=search; s=David+McCullough;st=author The GNU linker uses -v as a shortcut to --version,... http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=commit; h=40f0d175e0847d922faa85cc18ec01f2129bb2b9 My only question is why you are using the blackfin version of elf2flt for an ARM system ? It may be fine, I don't really know, but its primary purpose would be blackfind support I suspect ;-) I haven't played with elf2flt for a long time, but there are working ARM toolchains out there with elf2flt included. Build your ARM tool chain, then try this version of elf2flt: http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/elf2flt/ Otherwise, hopefully someone on the list is currently using something and can help you, Cheers, Davidm I was able to build the package properly and install it in my existing (above) toolchain, but now when I try to build a simple (hello) C user program using ?Wl,-elf2flt options, I am getting following errors : a. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: section .junk loaded at [,001f] overlaps section .text loaded at [,011f] b. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: BFD (GNU Binutils - STMicroelectronics/Linux Base) 2.20.51.20100809 assertion fail ../../bfd/elf32-arm.c:13377 Any Idea ? My doubt : Is ELF2FLT package compatible with the above mentioned versions of GCC/Binutils/uClibc for ARM-R4 used ? If anybody has tried to build a toolchain for ARM with this ELF2FLT package, can u help us with the versions of GCC/Binutils/uClibc ? Or may be if anyone knows any working ARM-CortexR4 working toolchain containing ELF2FLT ? Regards Pankaj Dev -- David McCullough, david_mccullo...@mcafee.com, Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt error with ARM Cortex-R4 toolchain
Jivin Pankaj DEV lays it down ... Hello, I am using ARM-Versatile Cortex-R4 platform and I have toolchain build with following components? versions : 1. GNU GCC : 4.6.3 20120301 2. GNU Binutils - 2.20.51.20100809 3. uClibc-nptl-0.9.33-66 To build the user application binary (FLAT), I downloaded the following(latest) version of ELF2FLT package from http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=summary 2011-04-04 David McCullough http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=search;s=David+McCullough;st=author The GNU linker uses -v as a shortcut to --version,... http://blackfin.uclinux.org/git/?p=users/vapier/elf2flt.git;a=commit;h=40f0d175e0847d922faa85cc18ec01f2129bb2b9 My only question is why you are using the blackfin version of elf2flt for an ARM system ? It may be fine, I don't really know, but its primary purpose would be blackfind support I suspect ;-) I haven't played with elf2flt for a long time, but there are working ARM toolchains out there with elf2flt included. Build your ARM tool chain, then try this version of elf2flt: http://cvs.uclinux.org/cgi-bin/cvsweb.cgi/elf2flt/ Otherwise, hopefully someone on the list is currently using something and can help you, Cheers, Davidm I was able to build the package properly and install it in my existing (above) toolchain, but now when I try to build a simple (hello) C user program using ?Wl,-elf2flt options, I am getting following errors : a. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: section .junk loaded at [,001f] overlaps section .text loaded at [,011f] b. /root/distro-armv7r/STLinux-2.4/devkit/armv7r_uclibc/arm-cortex-linux-uclibcgnueabi/bin/ld.real: BFD (GNU Binutils - STMicroelectronics/Linux Base) 2.20.51.20100809 assertion fail ../../bfd/elf32-arm.c:13377 Any Idea ? My doubt : Is ELF2FLT package compatible with the above mentioned versions of GCC/Binutils/uClibc for ARM-R4 used ? If anybody has tried to build a toolchain for ARM with this ELF2FLT package, can u help us with the versions of GCC/Binutils/uClibc ? Or may be if anyone knows any working ARM-CortexR4 working toolchain containing ELF2FLT ? Regards Pankaj Dev -- David McCullough, david_mccullo...@mcafee.com, Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt patch on mingw
Jivin Stanislav Meduna lays it down ... Hi, the attached patch is needed for the recent elf2flt on MinGW builds. The stat() cannot cope with directories ending with the directory separator. Applied, Thanks, Davidm diff -uNr elf2flt-orig/ld-elf2flt.c elf2flt/ld-elf2flt.c --- elf2flt-orig/ld-elf2flt.c 2010-08-17 06:25:26 +0200 +++ elf2flt/ld-elf2flt.c 2011-01-14 16:25:17 +0100 @@ -506,13 +507,15 @@ Make bindir point to the bin dir for bin/TARGET_ALIAS-foo. Make tooldir point to the bin dir for TARGET_ALIAS/bin/foo. */ if (streqn(elf2flt_progname, TARGET_ALIAS)) { - tmp = concat(argv0_dir, ../ TARGET_ALIAS /bin/, NULL); - if (stat(tmp, buf) == 0 S_ISDIR(buf.st_mode)) - tooldir = tmp; + tmp = concat(argv0_dir, ../ TARGET_ALIAS /bin, NULL); + if (stat(tmp, buf) == 0 S_ISDIR(buf.st_mode)) { + tooldir = concat(tmp, /, NULL); + } } else { - tmp = concat(argv0_dir, ../../bin/, NULL); - if (stat(tmp, buf) == 0 S_ISDIR(buf.st_mode)) - bindir = tmp; + tmp = concat(argv0_dir, ../../bin, NULL); + if (stat(tmp, buf) == 0 S_ISDIR(buf.st_mode)) { + bindir = concat(tmp, /, NULL); + } } /* Typically ld-elf2flt is invoked as `ld` which means error ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev -- David McCullough, david_mccullo...@mcafee.com, Ph:+61 734352815 McAfee - SnapGear http://www.mcafee.com http://www.uCdot.org ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt: putting .text and .data into separate segments
Hi Thomas, Thomas Schwinge wrote: Here is a patch to fix a ``misunderstanding'' between the kernel (bflt loader) and GDB; noticed on m68k / coldfire uClinux. Lacking specific directives in the linker script, the linker *may* decide to put .text and .data into the same segment: Section to Segment mapping: Segment Sections... 00 .text .data .eh_frame_hdr .eh_frame .bss 01 .eh_frame_hdr The bflt loader in the kernel will, however, add a small extra data table just before .data's content (cf. handling of MAX_SHARED_LIBS in binfmt_flat.c:load_flat_file). Now, if .text and .data are in the same segment, directly following each other in the binary file, but have that extra data table added in the run-time memory layout, GDB will get very confused when trying to access items in the now-moved .data section. Without any kernel (loader) / GDB changes, the solution is to tell the linker to always put .text and .data into separate segments, which GDB will handle gracefully then. Section to Segment mapping: Segment Sections... 00 .text 01 .data .eh_frame_hdr .eh_frame .bss Tested on m68k-uclinux (where the problem occurred) and arm-uclinuxeabi (no regressions). Applied to the elf2flt CVS. Thanks Greg 2010-02-27 Thomas Schwinge tho...@codesourcery.com * elf2flt.ld.in: Explicitly put .text and .data into separate segments. Index: elf2flt.ld.in === RCS file: /var/cvs/elf2flt/elf2flt.ld.in,v retrieving revision 1.3 diff -u -p -r1.3 elf2flt.ld.in --- elf2flt.ld.in 7 May 2009 06:14:27 - 1.3 +++ elf2flt.ld.in 27 Feb 2010 17:17:05 - @@ -5,6 +5,11 @@ MEMORY { flatmem : ORIGIN = 0x0, LENGTH = 0xfff } +PHDRS { + text PT_LOAD ; + data PT_LOAD ; +} + SECTIONS { .text 0x0 : { @@ -38,7 +43,7 @@ W_RODAT *(.gnu.linkonce.r*) . = ALIGN(0x20) ; @symbol_pre...@_etext = . ; - } flatmem + } flatmem :text .data : { . = ALIGN(0x4) ; @@ -130,7 +135,7 @@ TOR:@symbol_pre...@__dtor_end__ = .; KEEP (*(.fini_array)) KEEP (*(SORT(.fini_array.*))) PROVIDE (@symbol_pre...@__fini_array_end = .); - } flatmem + } flatmem :data .eh_frame_hdr : { *(.eh_frame_hdr) } flatmem .eh_frame : { KEEP(*(.eh_frame)) } flatmem Regards, Thomas ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev -- Greg Ungerer -- Principal EngineerEMAIL: g...@snapgear.com SnapGear Group, McAfee PHONE: +61 7 3435 2888 8 Gardner Close FAX: +61 7 3217 5323 Milton, QLD, 4064, AustraliaWEB: http://www.SnapGear.com ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt homepage
Mike Frysinger wrote: before i started working at ADI, i had only vaguely heard of elf2flt,.. ...i think the community would benefit greatly from having a homepage for this utility... Absolutely! ive started documenting things here: https://docs.blackfin.uclinux.org/doku.php?id=toolchain:elf2flt ... i'll probably start a FLAT page as well using this as a base: http://www.beyondlogic.org/uClinux/bflt.htm This is very useful and has hugely helped my understanding of the linking process. Thanks. Philip ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
RE: [uClinux-dev] elf2flt ctors?
Quoth Wolfgang Mües: The linking of crtbegin and crtend is disabled with --no-stdlibs. In the old uClinux distributions, this switch is embedded in ucfront. Wait, ucfront is old now? I'm still using a pre-ucfront distribution ;) ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt ctors?
Chetan, Am Freitag 30 Januar 2009 06:07:19 schrieb Chetan Murthy: I am having trouble getting my application that is statically linked against a rendering library to work on an ARM platform running uclinux. After some searching and debugging, I isolated the problem to be due some missing ctor symbols. Ah, yes. This is a long-lasting bug in uCLinux. Global static constructors are initialized from uClibc, at programm startup time, with a weak reference symbol. The code is in crtbegin.o and crtend.o. crtbegin must be the FIRST object in the list of linked files. At the end of crtbegin, a section with the list of global constructor is opened. crtend.o must be the LAST object in the list of linked files/libs. At the beginning of crtend, the section is closed with an end marker. Each object/library which has static constructors adds an entry to this list, and crtbegin and crtend do the embracement magic. The linking of crtbegin and crtend is disabled with --no-stdlibs. In the old uClinux distributions, this switch is embedded in ucfront. The quick fix is to include these files per hand like this: # Definitions for the inclusion of static constructors CRTBEGIN := $(shell $(CXX) $(CXXFLAGS) -print-file-name=crtbegin.o) CRTEND := $(shell $(CXX) $(CXXFLAGS) -print-file-name=crtend.o) # This is the rule that builds(links) the executable. # CXX: name of the c++ compiler, set by environment # CRTBEGIN/CRTEND: enclosure for inclusion of static constructors. # CRTBEGIN must be the first link object # CRTEND must be the last link object # LDFLAGS: common flags for the linker # CXXLIBS: needed libraries for C++ programs, including uClibc++ # LDLIBS: standard c libraries $(EXEC): $(OBJS) $(CXX) -o $@ $(CRTBEGIN) $(LDFLAGS) $(OBJS) $(CXXLIBS) $(LDLIBS) $(CRTEND) regards Wolfgang -- Wahre Worte sind nicht schön. Schöne Worte sind nicht wahr. (Laotse) ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
RE: [uClinux-dev] elf2flt errors
Hello Werner, Thanks for your reply, now the elf2flt error is gone, and a binary file called filt is made. However, when I tried to execute it, it shows cannot execute binary file! What should I do now? I'm developing in cygwin. Thanks. Mei -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Werner Cornelius Sent: Friday, December 14, 2007 3:52 AM To: uClinux development list Subject: Re: [uClinux-dev] elf2flt errors Am Donnerstag, 13. Dezember 2007 19:50 schrieb Mei Xu: Hello, Remove the 0x0 before the 0x0 from the .text section and try again. The flatmem reference after the closing brace for the memory should be sufficient. .text 0x0 : { to .text : { Best regards Werner Hello, Thanks for your quick response. The .junk 0 problem is easy to fix. What about the first error? ERROR: text=0x63c0 + data=0x746c overlaps bss=0x7550 ? I attached the generated LDSCRIPT, can you have a look to see if something is wrong with it? Thanks! Mei -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Werner Cornelius Sent: Thursday, December 13, 2007 1:07 AM To: uClinux development list Subject: Re: [uClinux-dev] elf2flt errors Am Donnerstag, 13. Dezember 2007 03:02 schrieb Mei Xu: Hello, Hello, When I used elf2flt tool, I got an error message: ERROR: text=0x63c0 + data=0x746c overlaps bss=0x7550 ? I checked the ELF file sections, and it looked like this: NameSizeVMA LMA File off .text 63c0 0040 .data 117063c063c0 6400 .bss62d075307530 7570 These sections are allocated in the memory space in sequence. I don't understand why the addresses of .text and .data need to be added to compare with .bss. It should add up the sizes instead, to my understanding. Also, in the linker script elf2flt.ld, .junk 0 : { *.rel*) *(.rela*) } Gave me this error: Section .junk [ - 000b] overlaps section .text [ - 63bf] This is in fact a direct error. Regarding to the upper listing .text starts at 0 and junk is defined to start at 0, too. And this generates an overlap. Did you intend to link a section for final address 0 but put into .text during load and moved inside the real system ? Then you would have to change the loadaddress inside the linker script. I suspect that the elf2flt.exe I have has something wrong. Anyone got the same error before? Please help. Where can I get the right version of elf2flt.exe? My target is MicroBlaze. Thank! Mei Xu Impulse Accelerated Technologies, Inc. [EMAIL PROTECTED] www.ImpulseC.com 550 Kirkland Way, Suite 408, Kirkland, WA 98033 tel: (425) 605-9543 ext. 110 fax: (425) 605-9544 Werner ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
RE: [uClinux-dev] elf2flt errors
Hello, Thanks for your quick response. The .junk 0 problem is easy to fix. What about the first error? ERROR: text=0x63c0 + data=0x746c overlaps bss=0x7550 ? I attached the generated LDSCRIPT, can you have a look to see if something is wrong with it? Thanks! Mei -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Werner Cornelius Sent: Thursday, December 13, 2007 1:07 AM To: uClinux development list Subject: Re: [uClinux-dev] elf2flt errors Am Donnerstag, 13. Dezember 2007 03:02 schrieb Mei Xu: Hello, Hello, When I used elf2flt tool, I got an error message: ERROR: text=0x63c0 + data=0x746c overlaps bss=0x7550 ? I checked the ELF file sections, and it looked like this: NameSizeVMA LMA File off .text 63c0 0040 .data 117063c063c0 6400 .bss62d075307530 7570 These sections are allocated in the memory space in sequence. I don't understand why the addresses of .text and .data need to be added to compare with .bss. It should add up the sizes instead, to my understanding. Also, in the linker script elf2flt.ld, .junk 0 : { *.rel*) *(.rela*) } Gave me this error: Section .junk [ - 000b] overlaps section .text [ - 63bf] This is in fact a direct error. Regarding to the upper listing .text starts at 0 and junk is defined to start at 0, too. And this generates an overlap. Did you intend to link a section for final address 0 but put into .text during load and moved inside the real system ? Then you would have to change the loadaddress inside the linker script. I suspect that the elf2flt.exe I have has something wrong. Anyone got the same error before? Please help. Where can I get the right version of elf2flt.exe? My target is MicroBlaze. Thank! Mei Xu Impulse Accelerated Technologies, Inc. [EMAIL PROTECTED] www.ImpulseC.com 550 Kirkland Way, Suite 408, Kirkland, WA 98033 tel: (425) 605-9543 ext. 110 fax: (425) 605-9544 Werner ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev flt-a00988 Description: Binary data ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org To unsubscribe see: http://mailman.uclinux.org/mailman/options/uclinux-dev
Re: [uClinux-dev] elf2flt
Roger, I agree with Andrew. It would be much easier if you compile your code with gcc rather then CodeWarrior. Regards, Fabio Estevam --- Andrew Webster [EMAIL PROTECTED] wrote: Why not use gcc instead of codewarrior? Andrew On 4/5/07, Roger Feltrin Escanhola [EMAIL PROTECTED] wrote: Hi Kalyan, Thanks for advice, but it didn't work. I tried to compile a new kernel image using make r, but the image was not created, an error occurred during the compilation. I am coping the end of the error message below: In file included from ctype.c:34: ../../../include/stdlib.h:494: warning: '__malloc__' attribute ignored m68k-elf-strip -x -R .note -R .comment .o m68k-elf-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno -strict-aliasing -Os -funit-at-a-time -m5307 -DCONFIG_COLDFIRE -O2 -g - fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -msep -data -fno-stack-protector -fno-builtin -nostdinc -D_LIBC -I../../../include -I. -isystem/usr/local/lib/gcc/m68k-uclinux/4.1.1/include -DNDEBUG -DL_ ctype.c -c -o .o In file included from ctype.c:34: ../../../include/stdlib.h:494: warning: '__malloc__' attribute ignored m68k-elf-strip -x -R .note -R .comment .o m68k-elf-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno -strict-aliasing -Os -funit-at-a-time -m5307 -DCONFIG_COLDFIRE -O2 -g - fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -msep -data -fno-stack-protector -fno-builtin -nostdinc -D_LIBC -I../../../include -I. -isystem/usr/local/lib/gcc/m68k-uclinux/4.1.1/include -DNDEBUG -DL_ ctype.c -c -o .o In file included from ctype.c:34: ../../../include/stdlib.h:494: warning: '__malloc__' attribute ignored m68k-elf-strip -x -R .note -R .comment .o m68k-elf-ar r ../../../libc/libc.a isalnum.o isalpha.o isascii.o iscntrl.o isdigit.o isgraph.o islower.o isprint.o ispunct.o isspace.o isupper.o isxdigit.o toascii.o tolower.o toupper.o isblank.o isxlower.o isxupper.o__ C_ctype_b.o __C_ctype_tolower.o __C_ctype_toupper.o __ctype_b_loc.o __ ctype_tolower_loc.o __ctype_toupper_loc.o __ctype_assert.o isctype.o m68k-elf-ar: isalnum.o: No such file or directory make[6]: *** [ar-target] Error 1 make[6]: Leaving directory `/ home/roger/uClinux-dist/uClibc/libc/misc/ctype' make[5]: *** [_dir_ctype] Error 2 make[5]: Leaving directory `/home/roger/uClinux-dist/uClibc/libc/misc' make[4]: *** [_dir_misc] Error 2 make[4]: Leaving directory `/home/roger/uClinux-dist/uClibc/libc' make[3]: ** [_dir_libc] Erro 2 make[3]: Leaving directory `/home/roger/uClinux-dist/uClibc' make[2]: ** [uClibc] Erro 2 make[2]: Leaving directory `/home/roger/uClinux-dist/lib' make[1]: ** [all] Erro 2 make[1]: Leaving directory `/home/roger/uClinux-dist/lib' make: ** [subdirs] Erro 1 Any suggestion to fix this? Regards http://www.v2telecom.com.br/ Roger Feltrin Escanhola 55 11 3094.3939 -Mensagem original- *De:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *Em nome de *Kalyan Tej *Enviada em:* quinta-feira, 5 de abril de 2007 01:07 *Para:* uClinux development list *Assunto:* RE: [uClinux-dev] elf2flt Hi, I don't know about the tools you r using but generally the error : Input file contains no relocation info can be eliminated by compling the application with a r option. And then use the elf2flt tool, To convert the elf into a flat binary. Regards, Kalyan -- *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Roger Feltrin Escanhola *Sent:* Thursday, April 05, 2007 4:18 AM *To:* uclinux-dev@uclinux.org *Subject:* [uClinux-dev] elf2flt I am new in this forum, I've had some troubles to run a application in uClinux. My target is a Coldfire microprocessor Kit Freescale (M5208EVB). I used Codewarrior to make a simple C program, but Codewarrior doesn't generate a binary flat file, so I can't run it on uClinux. Instead it makes an elf file when I compile it, so what I trying to do is to converter the elf file to flat file. Does any one know how to converter an elf file to a flat file? I have m68k-uclinux-tools-20060615.sh installed in my host (Fedora Core 5), I tried to converter an elf file using the following command: m68k-uclinux-elf2flt o image_out image.elf But it doesn't work and I receive the message image.elf: Input file contains no relocation info What am I doing wrong in this command? PS: image.elf is a file created when I run the make menuconfig of a new kernel. === message truncated === ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org
Re: [uClinux-dev] elf2flt
Roger, I agree with Andrew. It would be much easier if you compile your code with gcc rather then CodeWarrior. Regards, Fabio Estevam --- Andrew Webster [EMAIL PROTECTED] wrote: Why not use gcc instead of codewarrior? Andrew On 4/5/07, Roger Feltrin Escanhola [EMAIL PROTECTED] wrote: Hi Kalyan, Thanks for advice, but it didn't work. I tried to compile a new kernel image using make r, but the image was not created, an error occurred during the compilation. I am coping the end of the error message below: In file included from ctype.c:34: ../../../include/stdlib.h:494: warning: '__malloc__' attribute ignored m68k-elf-strip -x -R .note -R .comment .o m68k-elf-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno -strict-aliasing -Os -funit-at-a-time -m5307 -DCONFIG_COLDFIRE -O2 -g - fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -msep -data -fno-stack-protector -fno-builtin -nostdinc -D_LIBC -I../../../include -I. -isystem/usr/local/lib/gcc/m68k-uclinux/4.1.1/include -DNDEBUG -DL_ ctype.c -c -o .o In file included from ctype.c:34: ../../../include/stdlib.h:494: warning: '__malloc__' attribute ignored m68k-elf-strip -x -R .note -R .comment .o m68k-elf-gcc -Wall -Wstrict-prototypes -Wno-trigraphs -fno -strict-aliasing -Os -funit-at-a-time -m5307 -DCONFIG_COLDFIRE -O2 -g - fomit-frame-pointer -pipe -fno-common -fno-builtin -Wall -DEMBED -msep -data -fno-stack-protector -fno-builtin -nostdinc -D_LIBC -I../../../include -I. -isystem/usr/local/lib/gcc/m68k-uclinux/4.1.1/include -DNDEBUG -DL_ ctype.c -c -o .o In file included from ctype.c:34: ../../../include/stdlib.h:494: warning: '__malloc__' attribute ignored m68k-elf-strip -x -R .note -R .comment .o m68k-elf-ar r ../../../libc/libc.a isalnum.o isalpha.o isascii.o iscntrl.o isdigit.o isgraph.o islower.o isprint.o ispunct.o isspace.o isupper.o isxdigit.o toascii.o tolower.o toupper.o isblank.o isxlower.o isxupper.o__ C_ctype_b.o __C_ctype_tolower.o __C_ctype_toupper.o __ctype_b_loc.o __ ctype_tolower_loc.o __ctype_toupper_loc.o __ctype_assert.o isctype.o m68k-elf-ar: isalnum.o: No such file or directory make[6]: *** [ar-target] Error 1 make[6]: Leaving directory `/ home/roger/uClinux-dist/uClibc/libc/misc/ctype' make[5]: *** [_dir_ctype] Error 2 make[5]: Leaving directory `/home/roger/uClinux-dist/uClibc/libc/misc' make[4]: *** [_dir_misc] Error 2 make[4]: Leaving directory `/home/roger/uClinux-dist/uClibc/libc' make[3]: ** [_dir_libc] Erro 2 make[3]: Leaving directory `/home/roger/uClinux-dist/uClibc' make[2]: ** [uClibc] Erro 2 make[2]: Leaving directory `/home/roger/uClinux-dist/lib' make[1]: ** [all] Erro 2 make[1]: Leaving directory `/home/roger/uClinux-dist/lib' make: ** [subdirs] Erro 1 Any suggestion to fix this? Regards http://www.v2telecom.com.br/ Roger Feltrin Escanhola 55 11 3094.3939 -Mensagem original- *De:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *Em nome de *Kalyan Tej *Enviada em:* quinta-feira, 5 de abril de 2007 01:07 *Para:* uClinux development list *Assunto:* RE: [uClinux-dev] elf2flt Hi, I don't know about the tools you r using but generally the error : Input file contains no relocation info can be eliminated by compling the application with a r option. And then use the elf2flt tool, To convert the elf into a flat binary. Regards, Kalyan -- *From:* [EMAIL PROTECTED] [mailto: [EMAIL PROTECTED] *On Behalf Of *Roger Feltrin Escanhola *Sent:* Thursday, April 05, 2007 4:18 AM *To:* uclinux-dev@uclinux.org *Subject:* [uClinux-dev] elf2flt I am new in this forum, I've had some troubles to run a application in uClinux. My target is a Coldfire microprocessor Kit Freescale (M5208EVB). I used Codewarrior to make a simple C program, but Codewarrior doesn't generate a binary flat file, so I can't run it on uClinux. Instead it makes an elf file when I compile it, so what I trying to do is to converter the elf file to flat file. Does any one know how to converter an elf file to a flat file? I have m68k-uclinux-tools-20060615.sh installed in my host (Fedora Core 5), I tried to converter an elf file using the following command: m68k-uclinux-elf2flt o image_out image.elf But it doesn't work and I receive the message image.elf: Input file contains no relocation info What am I doing wrong in this command? PS: image.elf is a file created when I run the make menuconfig of a new kernel. === message truncated === ___ uClinux-dev mailing list uClinux-dev@uclinux.org http://mailman.uclinux.org/mailman/listinfo/uclinux-dev This message was resent by uclinux-dev@uclinux.org