This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Q: debugging linker scripts


On Sat, 2009-11-14 at 14:32 +0000, Dave Korn wrote:
> Danny Backx wrote:
> > How can I debug linker scripts ?
> > 
> > I'm working on an issue with cegcc : DLLs generated by it don't work on
> > Windows Mobile 6.1 and higher, they do still work with 6.0 .
> > 
> > The stuff I got from Kai is a good basis, Vincent R has given me a lot
> > of info on where the problems appear to be. Based on that, I'm fiddling
> > with the linker script.
> > 
> > But I cannot find a way to debug them. Is there a way for ld to print
> > variable values inside linker scripts ? A way to make the script put
> > stuff into a debug logfile ?
> 
>   Between them, the -Map and --verbose output usually give you most of the
> information you need to understand why ld does what it does; what else do you
> want to know?  (See also --enable-extra-pe-debug, which dumps a whole bunch of
> hard-to-read trace output.)

As I said earlier : this helped.

I'm still using the work by Kai Tietz with some linker script changes to
get cegcc to work for WM 6.1 .

The next problem I face is that gdb complains :

pavilion: {656} arm-mingw32ce-gdb d2.exe
GNU gdb 6.8
Copyright (C) 2008 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show
copying"
and "show warranty" for details.
This GDB was configured as "--host=i686-pc-linux-gnu
--target=arm-mingw32ce"...
Dwarf Error: wrong version in compilation unit header (is 0, should be
2) [in module /home/danny/tmp/arm/test/wm6.1/6.wm61dll/d2.exe]

This appears to be due to the fact that the first part of .debug_info is
filled with 0 bytes, for a length which matches the size of crt3.o
exactly.

Contents of section .debug_info:
 17000 00000000 00000000 00000000 00000000  ................
 17010 00000000 00000000 00000000 00000000  ................
[..]
 17270 00000000 00000000 00000000 00000000  ................
 17280 0000e301 00000200 d8000000 0401474e  ..............GN
 17290 55204320 342e342e 30000164 322e6300  U C 4.4.0..d2.c.
 172a0 2f686f6d 652f6461 6e6e792f 746d702f  /home/danny/tmp/

The crt3.o does have the right entry :
Contents of section .debug_info:
 0000 7e020000 02000000 00000401 474e5520  ~...........GNU 
 0010 4320342e 342e3000 012f686f 6d652f64  C 4.4.0../home/d
 0020 616e6e79 2f737263 2f636567 63632f73  anny/src/cegcc/s
 0030 766e2e73 662e6e65 742f6365 6763632f  vn.sf.net/cegcc/
 0040 7472756e 6b2f6365 6763632f 7372632f  trunk/cegcc/src/
 0050 6d696e67 772f6372 74332e63 00000000  mingw/crt3.c....
but it looks like this doesn't get copied in by LD.

The mapfile says :
.debug_info     0x00017000     0x1600
 *(.debug_info)
 .debug_info    0x00017000
0x282 /opt/mingw32ce/lib/gcc/arm-mingw32ce/4.4.0/../../../../arm-mingw32ce/lib/crt3.o
 .debug_info    0x00017282      0x1e7 /home/danny/tmp/ccWxQHuj.o
[..]

Where do I look for the cause of this problem ?

	Danny

-- 
Danny Backx ; danny.backx - at - scarlet.be ; http://danny.backx.info


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]