newlib dsPIC port
Leo Singer
doc.aronnax@gmail.com
Tue Feb 3 15:40:00 GMT 2009
Dear Karolina,
It appears that I do have the "iprintf" symbol, but my linker insists
otherwise. Do you know what is happening? See below.
Leo
On Mon, Feb 2, 2009 at 4:41 PM, <doc.aronnax@gmail.com> wrote:
> Calum, Karolina,
>
> I am trying to reproduce the linker script error using a very simple
> program, but I am still having trouble getting the toolchain to recognize
> printf. Here is my source file (yes, I know that I haven't set up the clock
> or anything else; it still should build, though).
>
> a.c:
> #include <stdio.h>
>
> int main()
> {
> printf("Hello, world!");
> return 0;
> }
>
> Here is my build script.
> build.sh:
> #!/bin/sh
>
> GCCFLAGS="-I../dest/pic30/include -L../dest/pic30/lib"
> GCCFLAGS="${GCCFLAGS} -Wl,--heap=1024"
> GCCFLAGS="${GCCFLAGS} -nostdlib"
> GCCFLAGS="${GCCFLAGS} -lc -lg -lm -lnosys"
> GCCFLAGS="${GCCFLAGS} -Wall -mlarge-code -mlarge-data -msmart-io=2"
> pic30-coff-gcc ${GCCFLAGS} a.c -o a.coff
>
>
> And here is the error message:
>
> /var/folders/gt/gtRt+RQ6H9ermdXw0qjcU++++TI/-Tmp-//ccVyTus5.o(.text+0x6):/Users/______/trx-svn/sandbox/newlib/test/a.c:
> undefined reference to `_iprintf'
> /var/folders/gt/gtRt+RQ6H9ermdXw0qjcU++++TI/-Tmp-//ccVyTus5.o(.text+0x8):/Users/______/trx-svn/sandbox/newlib/test/a.c:
> undefined reference to `_iprintf'
>
> (I've blanked out my user name with underscores).
>
> However, libc.a does seem to contain a definition of iprintf.
>
> pic30-nm libc.a | grep '_iprintf':
> 00000014 T __iprintf_r
> 00000026 t __iprintf_r
> 00000014 t _iprintf
> 00000000 T _iprintf
> 00000026 t __iprintf
> 00000012 T __iprintf
>
>
> What is going wrong?
>
> Leo
>
> On Feb 2, 2009 10:18am, Calum Wilkie <Calum.Wilkie@microchip.com> wrote:
>> Leo,
>>
>>
>>
>> This could be a bug in binutils. If you get the same error on windows
>> then we would need to see the objects and link line in order to reproduce
>> it...
>>
>>
>>
>> Regards
>>
>> Calum
>>
>>
>>
>> On Feb 1, 2009, at 3:22 PM, Leo Singer wrote:
>>
>>
>>
>>
>> Calum,
>>
>>
>>
>> When attempting to link Newlib with my existing projects, I get the
>>
>> following error message:
>>
>>
>>
>> Link Error: can't get section .dinit%113 contents
>>
>> /opt/pic/bin/pic30-coff-ld: BFD 2.14 20030612 internal error, aborting
>>
>> at ../../acme/bfd/coff-pic30.c line 1352 in pic30_final_link
>>
>>
>>
>> /opt/pic/bin/pic30-coff-ld: Please report this bug.
>>
>>
>>
>> What might cause this?
>>
>>
>>
>> Leo
>>
>>
>>
>> On Sun, Feb 1, 2009 at 12:42 PM, Calum.Wilkie@microchip.com> wrote:
>>
>>
>>
>>
>> Leo,
>>
>>
>>
>> I hope that this is not an intrusion. My name is Calum and I work at
>>
>> Microchip and am primarily responsible for development of the compiler
>>
>> portions of MPLAB C30. I am writing to let you know that I am will to
>> help
>>
>> with this port in my spare time (I do not think that Microchip will
>> sponsor
>>
>> this time, but I think that it is valuable and I can help in a skunk-works
>>
>> way).
>>
>>
>>
>> If this is something that you would be interested in, please feel free to
>>
>> let me know.
>>
>>
>>
>> The compiler group have been suggesting alternative C libraries to our
>>
>> current release for quite some time (but you know how this sometimes goes
>> at
>>
>> business, perhaps).
>>
>>
>>
>> Regards
>>
>> Calum
>>
>>
>>
>>
>> Calum Wilkie Microchip Technology, Compiler Group
>> +1 480 792 7114
>>
>>
>>
More information about the Newlib
mailing list