[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [microblaze-uclinux] ld segfault



Hi John,

I checked the line which triggered the bug, it is in the file
petalinux/tools/linux-i386/microblaze-uclinux-tools/microblaze-uclinux/bin/ld.
Specifically is line number 151:

$LINKER $EMUL -r -d -o "$OFILE.elf2flt" $ARG1   --verbose
||exit $?

As you can see, I added --verbose option and thanks to that I could
see what libraries are linked. Sometimes, it fails trying to opening
the libraries because they are not found, but it always find the
'correct' place were the libreries are (I guess it is the correct
place). This is the code that is shown thanks to '--verbose' option:


attempt to open
/root/petalinux3/software/petalinux-dist/lib/libpthread.a failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/bs/m/libpthread.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/libpthread.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/libpthread.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/../../../../microblaze-uclinux/lib/bs/m/libpthread.a
succeeded

attempt to open /root/petalinux3/software/petalinux-dist/lib/libm.a failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/bs/m/libm.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/libm.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/libm.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/../../../../microblaze-uclinux/lib/bs/m/libm.a
succeeded

attempt to open /root/petalinux3/software/petalinux-dist/lib/libjpeg.a
succeeded
attempt to open /root/petalinux3/software/petalinux-dist/lib/libpng.a
succeeded
attempt to open /root/petalinux3/software/petalinux-dist/lib/libz.a succeeded
attempt to open
/root/petalinux3/software/petalinux-dist/lib/libminigui.a succeeded

attempt to open /root/petalinux3/software/petalinux-dist/lib/libgcc.a failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/bs/m/libgcc.a
succeeded

attempt to open /root/petalinux3/software/petalinux-dist/lib/libc.a failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/bs/m/libc.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/libc.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/libc.a
failed
attempt to open
/root/petalinux3/tools/linux-i386/microblaze-uclinux-tools/bin/../lib/gcc/microblaze-uclinux/3.4.1/../../../../microblaze-uclinux/lib/bs/m/libc.a
succeeded


After that, I used the command 'microblaze-uclinux-objdump -t
libraryname.a' and I could see that, in all cases, the objects of the
libraries were reported as 'file format elf32-microblaze'. Is this
file format correct?

If the file format is correct, do you know what could make a segment
fault like that in 'ld'?

I compile the library Minigui like this:

CC=microblaze-uclinux-gcc LDFLAGS="-Wall -elf2flt" ./configure
--build=i386 --host=microblaze-uclinux --target=microblaze-uclinux
--disable-shared

Thank you in advance for your help John.

Kind regards,

Pablo Colodron,


John Williams escribió:
Hi Pablo,

On Thu, May 21, 2009 at 7:32 PM,  <pcolodron@xxxxxxxx> wrote:

When I compile the application, I can see the following error:

microblaze-uclinux/bin/ld: line 168: 27630 Segmentation fault      $LINKER
$EMUL -r -d -o "$OFILE.elf2flt" $ARG1
collect2: ld returned 139 exit status


It is probably a problem related to how I compile the library. Maybe I have
some x86 objects in my library and I do not know.

It is a likely cause.

Could you tell me Rod or John how to check this? You told that you used the
vervose output from mb-strip. Could you explain how to do it?

Basically take a look at thegcc or ld command line that is triggering
the bug.  Run that command manually, but att -v (for verbose), it
should give you a list of all object (.o) and library (.a) files that
are part of the link.  Ten check each of those with "mb-objdump -t
<filename>", it shold report them as microblaze binaries.

Regards,

John




----- Terminar mensaxe reenviada -----


___________________________
microblaze-uclinux mailing list
microblaze-uclinux@xxxxxxxxxxxxxx
Project Home Page : http://www.itee.uq.edu.au/~jwilliams/mblaze-uclinux
Mailing List Archive : http://www.itee.uq.edu.au/~listarch/microblaze-uclinux/