This is almost certainly
https://sourceforge.net/tracker/?func=detail&aid=3143071&group_id=42303&atid=432701,
for which a patch is available at
https://sourceforge.net/projects/mspgcc/files/Patches/LTS/20110716/.  When
running your example with the current version, I get:

vmserver[13]$ /msp430/install/lts-20110716/bin/msp430-gcc -c a.c
vmserver[14]$ /msp430/install/lts-20110716/bin/msp430-gcc -c b.c
vmserver[15]$ /msp430/install/lts-20110716/bin/msp430-ld -r a.o b.o -o ab.o
vmserver[16]$ /msp430/install/lts-20110716/bin/msp430-objdump -r ab.o

ab.o:     file format elf32-msp430

RELOCATION RECORDS FOR [.text]:
OFFSET   TYPE              VALUE
00000010 R_MSP430_16_BYTE  .text
00000026 R_MSP430_16_BYTE  .text+0x00000016

Please contact Ubuntu or whoever provided your packages and have them apply
the current patch set.

Peter

2011/11/2 Gaëtan Leurent <gaetan.leur...@normalesup.org>

> I think I'm hitting a bug where msp430-ld doesn't update relocations
> correctly when doing partial linking.
>
> When some relocations are defined with reference to the .text section,
> I would expect ld to update the relocations to refer to the new merged
> .text section, but the relocation are just kept as is.  This result in
> bad relocations in the merged object.
>
>
> Here is a simple example (I'm using version 2.21.52.20110606 from Ubuntu):
>
>
> gaetan@Ubuntu-VBox:~/ecm$ cat a.c
> char* frobnicate() {
>  return "Zoinx!\n";
> }
> gaetan@Ubuntu-VBox:~/ecm$ cat b.c
> char* frobnicate2() {
>  return "Pouet!\n";
> }
> gaetan@Ubuntu-VBox:~/ecm$ msp430-gcc a.c
> gaetan@Ubuntu-VBox:~/ecm$ msp430-gcc b.c
> gaetan@Ubuntu-VBox:~/ecm$ msp430-ld -r a.o b.o -o ab.o
> gaetan@Ubuntu-VBox:~/ecm$ msp430-objdump -r ab.o
>
> ab.o:     file format elf32-msp430
>
> RELOCATION RECORDS FOR [.text]:
> OFFSET   TYPE              VALUE
> 00000010 R_MSP430_16_BYTE  .text
> 00000026 R_MSP430_16_BYTE  .text
>
>
> In the merged object the two relocations refer to the same place, which
> look like an obvious mistake.  When using a regular x86 binutils, I do
> have two different relocations.
>
>
> Please tell me if this should rather be reported to the upstream
> binutils.
>
> --
> Gaëtan Leurent
>
>
> ------------------------------------------------------------------------------
> RSA&#174; Conference 2012
> Save $700 by Nov 18
> Register now&#33;
> http://p.sf.net/sfu/rsa-sfdev2dev1
> _______________________________________________
> Mspgcc-users mailing list
> Mspgcc-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/mspgcc-users
>
------------------------------------------------------------------------------
RSA&#174; Conference 2012
Save $700 by Nov 18
Register now&#33;
http://p.sf.net/sfu/rsa-sfdev2dev1
_______________________________________________
Mspgcc-users mailing list
Mspgcc-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/mspgcc-users

Reply via email to