Re: [Mspgcc-users] linker relocation errors

2013-10-25 Thread kaask...@knersus.co.za
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.zakaask...@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

[Mspgcc-users] linker relocation errors

2013-10-24 Thread kaask...@knersus.co.za
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'. 

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:
previous posting
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.
previous posting

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

--- 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-includeignoring 
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 

Re: [Mspgcc-users] linker relocation errors

2013-10-24 Thread Eric Decker
I don't think this is the same but try this patch:….

+++ a/bfd/elf32-msp430.c 2013-07-24 23:48:07.731767510 -0700
--- b/bfd/elf32-msp430.c 2013-07-24 23:54:57.073797079 -0700
@@ -27,6 +27,7 @@
 #include elf-bfd.h
 #include elf/msp430.h
 #include assert.h
+#include string.h

 /* 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:
 previous posting
 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.
 previous posting

 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__