Thanks for that, I will apply it and provide feedback.
From: cire...@gmail.com
Sent: 2013/10/25 01:17:00 AM
To: kaask...@knersus.co.za
Cc: mspgcc-users@lists.sourceforge.net
Subject: RE: Re: [Mspgcc-users] linker relocation errors 
I don't think this is the same but try this patch:….
+++ a/bfd/elf32-msp430.c2013-07-24 23:48:07.731767510 -0700--- 
b/bfd/elf32-msp430.c2013-07-24 23:54:57.073797079 -0700@@ -27,6 +27,7 @@ 
#include "elf-bfd.h" #include "elf/msp430.h" #include +#include   /* Use RELA 
instead of REL.  */ #undef USE_REL@@ -754,8 +755,12 @@     case 
R_MSP430_16_PCREL_BYTE:     case R_MSP430_16_BYTE:       bfd_put_16 (input_bfd, 
MSP430_MASK_16 (srel), contents);-      if (r == bfd_reloc_ok && 
!MSP430_16_IN_RANGE (srel))-r = bfd_reloc_overflow;+      if (r == bfd_reloc_ok 
&& !MSP430_16_IN_RANGE (srel)) {+        printf("srel = 0x%X, name = %s, 
section = %s\n", (unsigned int) srel,+            howto->name, 
input_section->name);+        if (strcmp(input_section->name, ".debug_loc") != 
0)+          r = bfd_reloc_overflow;+      }       break;      case 
R_MSP430X_SRC:


On Thu, Oct 24, 2013 at 5:08 AM, kaask...@knersus.co.za<kaask...@knersus.co.za> 
wrote:
Hi,

 During the linker phase, the following errors "relocation truncated to fit: 
R_MSP430_16_BYTE against `no symbol'" cause the linker to exit.
 Also it appears `.text' will not fit in region `rom'.

how are you compiling?   What optimization are you using?

-O3 does an optimization for speed which generally causes code to expand.   Try 
-Os for space minimization.
 
 I have built mspgcc 20120406 from source. I followed the install from source 
as on the wiki. I had an issue with msp430-libc make install, but if I recall 
correctly was only a directory that did not exist - which I manually created to 
make the install work.
 Please ignoere the "undefined references" in the compiler output snippet 
below. That is due to a compiler option flag I removed.

 I have swept trough a few previous posts in the archive and one suggests that 
this issue might be related to:


a validation done inside bfd/elf32-msp430.c  "function 
msp430_final_link_relocate" The MSP430_16_IN_RANGE (srel) returns 0 and and the 
ld code goes on the error path from here.



I would appreciated it if you coudl have a look at the compile log snippet 
below and comment. I am compiling for the MSP420F2553.

Vincent


In the future bundle the output and call it …     output.txt    …   then attach 
the file.
that way we can actually read the output. 

----------------------------------- snip 
--------------------------------------------------------

GNU C (GCC) version 4.6.3 20120301 (mspgcc LTS 20120406 unpatched) 
(msp430)compiled by GNU C version 4.6.3 20120306 (Red Hat 4.6.3-2), GMP version 
4.3.2, MPFR version 3.0.0, MPC version 0.8.3-devGGC heuristics: --param 
ggc-min-expand=100 --param ggc-min-heapsize=131072Compiler executable checksum: 
c27679b30956b459154df91f6373f3cc/home/vincent/VinLaunchPad/AllExamples/Common/printf.c:32:13:
 warning: ‘buf’ defined but not used 
[-Wunused-variable]/home/vincent/VinLaunchPad/AllExamples/Common/printf.c:46:13:
 warning: ‘divOut’ defined but not used 
[-Wunused-function]COLLECT_GCC_OPTIONS='-mmcu=msp430g2553' '-D' 'LAUNCHPAD' 
'-D' 'ZM_PHY_SPI' '-D' 'REGION_EUROPE' '-I' '/usr/local/msp430/include' '-O3' 
'-Wall' '-c' '-fmessage-length=0' '-std=c99' '-v' '-MMD' '-MP' '-MF' 
'Common/printf.d' '-MT' 'Common/printf.d' '-o' 'Common/printf.o' '-mcpu=430' 
'-mmpy=none' '-mivcnt=16' 
/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/as -mcpu=430 
-mmcu=msp430g2553 -o Common/printf.o 
/tmp/ccVS2wxj.sCOMPILER_PATH=/usr/local/libexec/gcc/msp430/4.6.3/:/usr/local/libexec/gcc/msp430/4.6.3/:/usr/local/libexec/gcc/msp430/:/usr/local/lib/gcc/msp430/4.6.3/:/usr/local/lib/gcc/msp430/:/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/LIBRARY_PATH=/usr/local/lib/gcc/msp430/4.6.3/:/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/lib/COLLECT_GCC_OPTIONS='-mmcu=msp430g2553'
 '-D' 'LAUNCHPAD' '-D' 'ZM_PHY_SPI' '-D' 'REGION_EUROPE' '-I' 
'/usr/local/msp430/include' '-O3' '-Wall' '-c' '-fmessage-length=0' '-std=c99' 
'-v' '-MMD' '-MP' '-MF' 'Common/printf.d' '-MT' 'Common/printf.d' '-o' 
'Common/printf.o' '-mcpu=430' '-mmpy=none' '-mivcnt=16'Using built-in 
specs.Reading specs from 
/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/lib/msp430mcu.specCOLLECT_GCC=msp430-gccCOLLECT_LTO_WRAPPER=/usr/local/libexec/gcc/msp430/4.6.3/lto-wrapperTarget:
 msp430Configured with: ../gcc-4.6.3/configure --target=msp430 
--enable-languages=c --program-prefix=msp430-Thread model: singlegcc version 
4.6.3 20120301 (mspgcc LTS 20120406 unpatched) (GCC) 
COLLECT_GCC_OPTIONS='-mmcu=msp430g2553' '-D' 'LAUNCHPAD' '-D' 'ZM_PHY_SPI' '-D' 
'REGION_EUROPE' '-I' '/usr/local/msp430/include' '-O3' '-Wall' '-c' 
'-fmessage-length=0' '-std=c99' '-v' '-MMD' '-MP' '-MF' 'Common/utilities.d' 
'-MT' 'Common/utilities.d' '-o' 'Common/utilities.o' '-mcpu=430' '-mmpy=none' 
'-mivcnt=16' /usr/local/libexec/gcc/msp430/4.6.3/cc1 -quiet -v -I 
/usr/local/msp430/include -MMD Common/utilities.d -MF Common/utilities.d -MP 
-MT Common/utilities.d -D__MSP430G2553__ -D LAUNCHPAD -D ZM_PHY_SPI -D 
REGION_EUROPE /home/vincent/VinLaunchPad/AllExamples/Common/utilities.c 
-mcpu=430 -mmpy=none -mivcnt=16 -quiet -dumpbase utilities.c -mmcu=msp430g2553 
-mcpu=430 -mmpy=none -mivcnt=16 -auxbase-strip Common/utilities.o -O3 -Wall 
-std=c99 -version -fmessage-length=0 -o /tmp/cca1KY5m.sGNU C (GCC) version 
4.6.3 20120301 (mspgcc LTS 20120406 unpatched) (msp430)compiled by GNU C 
version 4.6.3 20120306 (Red Hat 4.6.3-2), GMP version 4.3.2, MPFR version 
3.0.0, MPC version 0.8.3-devGGC heuristics: --param ggc-min-expand=100 --param 
ggc-min-heapsize=131072ignoring nonexistent directory 
"/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/sys-include"ignoring 
duplicate directory "/usr/local/msp430/include"  as it is a non-system 
directory that duplicates a system directory#include "..." search starts 
here:#include <...> search starts here: /usr/local/lib/gcc/msp430/4.6.3/include 
/usr/local/lib/gcc/msp430/4.6.3/include-fixed 
/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/includeEnd of search 
list.GNU C (GCC) version 4.6.3 20120301 (mspgcc LTS 20120406 unpatched) 
(msp430)compiled by GNU C version 4.6.3 20120306 (Red Hat 4.6.3-2), GMP version 
4.3.2, MPFR version 3.0.0, MPC version 0.8.3-devGGC heuristics: --param 
ggc-min-expand=100 --param ggc-min-heapsize=131072Compiler executable checksum: 
c27679b30956b459154df91f6373f3ccCOLLECT_GCC_OPTIONS='-mmcu=msp430g2553' '-D' 
'LAUNCHPAD' '-D' 'ZM_PHY_SPI' '-D' 'REGION_EUROPE' '-I' 
'/usr/local/msp430/include' '-O3' '-Wall' '-c' '-fmessage-length=0' '-std=c99' 
'-v' '-MMD' '-MP' '-MF' 'Common/utilities.d' '-MT' 'Common/utilities.d' '-o' 
'Common/utilities.o' '-mcpu=430' '-mmpy=none' '-mivcnt=16' 
/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/as -mcpu=430 
-mmcu=msp430g2553 -o Common/utilities.o 
/tmp/cca1KY5m.sCOMPILER_PATH=/usr/local/libexec/gcc/msp430/4.6.3/:/usr/local/libexec/gcc/msp430/4.6.3/:/usr/local/libexec/gcc/msp430/:/usr/local/lib/gcc/msp430/4.6.3/:/usr/local/lib/gcc/msp430/:/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/LIBRARY_PATH=/usr/local/lib/gcc/msp430/4.6.3/:/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/lib/COLLECT_GCC_OPTIONS='-mmcu=msp430g2553'
 '-D' 'LAUNCHPAD' '-D' 'ZM_PHY_SPI' '-D' 'REGION_EUROPE' '-I' 
'/usr/local/msp430/include' '-O3' '-Wall' '-c' '-fmessage-length=0' '-std=c99' 
'-v' '-MMD' '-MP' '-MF' 'Common/utilities.d' '-MT' 'Common/utilities.d' '-o' 
'Common/utilities.o' '-mcpu=430' '-mmpy=none' 
'-mivcnt=16'/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: 
PrVinCoordinator.elf section `.text' will not fit in region 
`rom'/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: section 
.vectors loaded at [0000ffe0,0000ffff] overlaps section .text loaded at 
[0000c000,00011263]/usr/local/lib/gcc/msp430/4.6.3/../../../../msp430/bin/ld: 
region `rom' overflowed by 9890 
bytes/usr/local/lib/gcc/msp430/4.6.3/libcrt0.a(_copy_data.o): In function 
`__do_copy_data':/home/vincent/VinLaunchPad/bin_downloaded/mspgcc-20120406/gcc/gcc/../../gcc-4.6.3/gcc/config/msp430/crt0.S:195:
 relocation truncated to fit: R_MSP430_16_BYTE against symbol 
`__data_load_start' defined in *ABS* section in 
PrVinCoordinator.elf./ZM_Examples/example_simple_application_coordinator_afzdo.o:
 In function 
`processButtonPress':example_simple_application_coordinator_afzdo.c:(.text+0x20):
 relocation truncated to fit: R_MSP430_16_BYTE against `no 
symbol'example_simple_application_coordinator_afzdo.c:(.text+0x28): relocation 
truncated to fit: R_MSP430_16_BYTE against `no 
symbol'example_simple_application_coordinator_afzdo.c:(.text+0x2c): relocation 
truncated to fit: R_MSP430_16 against symbol `tfp_printf' defined in .text 
section in 
./Common/printf.oexample_simple_application_coordinator_afzdo.c:(.text+0x42): 
relocation truncated to fit: R_MSP430_16_BYTE against `no 
symbol'example_simple_application_coordinator_afzdo.c:(.text+0x46): relocation 
truncated to fit: R_MSP430_16 against symbol `tfp_printf' defined in .text 
section in 
./Common/printf.oexample_simple_application_coordinator_afzdo.c:(.text+0x4c): 
undefined reference to 
`resetNominalTemperature'example_simple_application_coordinator_afzdo.c:(.text+0x50):
 undefined reference to 
`resetNominalColor'example_simple_application_coordinator_afzdo.c:(.text+0x72): 
relocation truncated to fit: R_MSP430_16_BYTE against `no 
symbol'./ZM_Examples/example_simple_application_coordinator_afzdo.o:(.rodata+0x26e):
 relocation truncated to fit: R_MSP430_16_BYTE against `no 
symbol'./ZM_Examples/example_simple_application_coordinator_afzdo.o:(.rodata+0x270):
 relocation truncated to fit: R_MSP430_16_BYTE against `no 
symbol'./ZM_Examples/example_simple_application_coordinator_afzdo.o:(.rodata+0x272):
 relocation truncated to fit: R_MSP430_16_BYTE against `no 
symbol'./ZM_Examples/example_simple_application_coordinator_afzdo.o: In 
function `main':example_simple_application_coordinator_afzdo.c:(.init9+0x14): 
additional relocation overflows omitted from the 
outputexample_simple_application_coordinator_afzdo.c:(.init9+0x1d8): undefined 
reference to 
`displayTemperatureOnRgbLed'example_simple_application_coordinator_afzdo.c:(.init9+0x26c):
 undefined reference to `displayColorOnRgbLed'collect2: ld returned 1 exit 
statusmake: *** [PrVinCoordinator.elf] Error 1


 ----------------------------------- snip 
--------------------------------------------------------

Sent from MWEB Message Centre - CONNECT AND YOU CAN

------------------------------------------------------------------------------

October Webinars: Code for Performance

Free Intel webinars can help you accelerate application performance.

Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from

the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________


Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users




-- 
Eric B. Decker
Senior (over 50 :-) Researcher
------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to