strange Bug

Björn Döbel doebel at os.inf.tu-dresden.de
Mon Dec 1 12:36:45 CET 2014


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 30.11.2014 19:59, ba_f wrote:
> Hello,
> 
> 
>> Debugging quickfix: link your program statically to identify the 
>> faulty location.
> 
> Unfortunately, no success neither.
> 
> I made libClients.a link with myClient. Still there is some dynamic
> linking, i couldn't get rid of. And MODE=shared must be set to
> build successfully. Is there a file, listing all files for the
> Linker? Maybe i could check there which .so is needed for
> building.

No .so files are needed for static linking. What error are you getting
if you remove MODE=shared?

> Objdump gives me the following, but i guess that comes from
> MODE=shared:
> 
> NEEDED               libc_be_sig.so NEEDED
> libpthread.so NEEDED               libld-l4.so NEEDED
> libdl.so NEEDED               libc_support_misc.so NEEDED
> libc_be_socket_noop.so NEEDED               lib4re-util.so NEEDED
> libc_be_l4refile.so NEEDED               libc_be_l4re.so NEEDED
> libsupc++.so NEEDED               libuc_c.so NEEDED
> lib4re.so NEEDED               libl4util.so NEEDED
> libl4sys.so
> 
> 
> Anyway...

There are static library equivalents for all those. Sounds like
setting the proper REQUIRES_LIBS in your Makefile should do the trick.

>> Alternative (not recommended before you tried the quickfix):
>> obtain dynamic loading info using the LD_DEBUG environment
>> variable and figure out which library gets mapped to the
>> respective address.
> 
> ...this looks promising.
> 
> But, do you know how to get the output of LD_DEBUG? I run on an
> embedded ARM with UART-output.
> 
> I set 'LD_DEBUG=all' in the Makefile of myClient. Normally, i'd
> specify the output there. E.g. 'LD_DEBUG=all cat'

LD_DEBUG is an environment variable, so specifying it at compile time
in the Makefile is not useful. Instead, add it as an environment
variable to your setup:

L4.default_loader.start( { caps ...},
                         "rom/myProgram",
                         { LD_DEBUG=all }
};

Again, I would go for the static linking route.

Bjoern
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlR8UsoACgkQP5ijxgQLUNnbRQCfWjlo/a8AZqRyLF4JIOeoNW97
rF4AoIngrY5dRQZ1TiPjgZ+t2rXo1RyL
=z0Ru
-----END PGP SIGNATURE-----



More information about the l4-hackers mailing list