Menu

some portability suggestions

2004-10-14
2013-04-09
  • Andrew Marlow

    Andrew Marlow - 2004-10-14

    I had a look at solving this problem a while ago. It is interesting to see your approach. Your code is better than mine in many ways but your approach, IMO, it not as portable. I will describe where we differ:

    I wrote a perl script, deplib.pl, to process the output from the nm command into a machine neutral form. Each record output from deplib.pl is of the form:

    libraryname|symbolName|value

    where a value of 0 means referenced, 1 means defined.

    I have a program, depdot which takes the output from deplib.pl and produces the dot file, writing to stdout. deplib.pl and depdot are designed to work as filters, i.e they read from stdin and write to stdout. Any errors are written to stderr.

    IMO this approach is better because to port to another platform just involves changing the perl script. I have versions of the perl script for Linux and for Solaris.

    Regards,

    Andrew Marlow

     
    • Eddy Pronk

      Eddy Pronk - 2005-08-13

      You're right. It's less portable in the sense that it's depending on GNU bfd. This makes it restricted to the binary formats supported by GNU Binutils. At the moment it  works on Linux and Windows/Cygwin.

      I started with a perl script b.t.w. :)

      Eddy

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.