EnglishFrenchSpanish

Ad


OnWorks favicon

mono-shlib-cop - Online in the Cloud

Run mono-shlib-cop in OnWorks free hosting provider over Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

This is the command mono-shlib-cop that can be run in the OnWorks free hosting provider using one of our multiple free online workstations such as Ubuntu Online, Fedora Online, Windows online emulator or MAC OS online emulator

PROGRAM:

NAME


mono-shlib-cop - Shared Library Usage Checker

SYNOPSIS


mono-shlib-cop [OPTIONS]* [ASSEMBLY-FILE-NAME]*

OPTIONS


-p, --prefixes=PREFIX
Mono installation prefixes. This is to find $prefix/etc/mono/config. The default
is based upon the location of mscorlib.dll, and is normally correct.

DESCRIPTION


mono-shlib-cop is a tool that inspects a managed assembly looking for erroneous or
suspecious usage of shared libraries.

The tool takes one or more assembly filenames, and inspects each assembly specified.

The errors checked for include:

* Does the shared library exist?

* Does the requested symbol exist within the shared library?

The warnings checked for include:

* Is the target shared library a versioned library? (Relevant only on Unix systems,
not Mac OS X or Windows.)

In general, only versioned libraries such as libc.so.6 are present on the user's machine,
and efforts to load libc.so will result in a System.DllNotFoundException. There are three
solutions to this:

1. Require that the user install any -devel packages which provide the unversioned
library. This usually requires that the user install a large number of additional
packages, complicating the installation process.

2. Use a fully versioned name in your DllImport statements. This requires editing
your source code and recompiling whenever you need to target a different version of
the shared library.

3. Provide an assembly.config file which contains <dllmap/> elements to remap the
shared library name used by your assembly to the actual versioned shared library
present on the users system. Mono provides a number of pre-existing <dllmap/>
entries, including ones for libc.so and libX11.so.

EXAMPLE


The following code contains examples of the above errors and warnings:
using System.Runtime.InteropServices; // for DllImport
class Demo {
[DllImport ("bad-library-name")]
private static extern void BadLibraryName ();

[DllImport ("libc.so")]
private static extern void BadSymbolName ();

[DllImport ("libcap.so")]
private static extern int cap_clear (IntPtr cap_p);
}

Bad library name
Assuming that the library bad-library-name doesn't exist on your machine,
Demo.BadLibraryName will generate an error, as it requires a shared library which
cannot be loaded. This may be ignorable; see BUGS

Bad symbol name
Demo.BadSymbolName will generate an error, as libc.so (remapped to libc.so.6 by
mono's $prefix/etc/mono/config file) doesn't contain the function BadSymbolName

Unversioned library dependency
Assuming you have the file libcap.so , Demo.cap_clear will generate a warning
because, while libcap.so could be loaded, libcap.so might not exist on the users
machine (on FC2, /lib/libcap.so is provided by libcap-devel , and you can't assume
that end users will have any -devel packages installed).

FIXING CODE


The fix depends on the warning or error:

Bad library names
Use a valid library name in the DllImport attribute, or provide a <dllmap/> entry
to map your existing library name to a valid library name.

Bad symbol names
Reference a symbol that actually exists in the target library.

Unversioned library dependency
Provide a <dllmap/> entry to reference a properly versioned library, or ignore the
warning (see BUGS ).

DLLMAP ENTRIES


Mono looks for an ASSEMBLY-NAME mapping information. For example, with mcs.exe , Mono
would read mcs.exe.config , and for Mono.Posix.dll , Mono would read Mono.Posix.dll.config

The .config file is an XML document containing a top-level <configuration/> section with
nested <dllmap/> entries, which contains dll and target attributes. The dll attribute
should contain the same string used in your DllImport attribute value, and the target
attribute specifies which shared library mono should actually load at runtime.

A sample .config file is:
<configuration>
<dllmap dll="gtkembedmoz" target="libgtkembedmoz.so" />
</configuration>

Use mono-shlib-cop online using onworks.net services


Free Servers & Workstations

Download Windows & Linux apps

  • 1
    wxPython
    wxPython
    A set of Python extension modules that
    wrap the cross-platform GUI classes from
    wxWidgets.. Audience: Developers. User
    interface: X Window System (X11), Win32 ...
    Download wxPython
  • 2
    packfilemanager
    packfilemanager
    This is the Total War pack file manager
    project, starting from version 1.7. A
    short introduction into Warscape
    modding: ...
    Download packfilemanager
  • 3
    IPerf2
    IPerf2
    A network traffic tool for measuring
    TCP and UDP performance with metrics
    around both throughput and latency. The
    goals include maintaining an active
    iperf cod...
    Download IPerf2
  • 4
    fre:ac - free audio converter
    fre:ac - free audio converter
    fre:ac is a free audio converter and CD
    ripper for various formats and encoders.
    It features MP3, MP4/M4A, WMA, Ogg
    Vorbis, FLAC, AAC, and Bonk format
    support, ...
    Download fre:ac - free audio converter
  • 5
    BotMan
    BotMan
    Write your chatbot logic once and
    connect it to one of the available
    messaging services, including Amazon
    Alexa, Facebook Messenger, Slack,
    Telegram or even yo...
    Download BotMan
  • 6
    gerbv  a Gerber (RS-274X) viewer
    gerbv a Gerber (RS-274X) viewer
    Gerbv is an open source Gerber file
    (RS-274X only) viewer. Gerbv lets you
    load several files on top of each other,
    do measurements on the displayed image,
    etc. ...
    Download gerbv a Gerber (RS-274X) viewer
  • 7
    Iometer
    Iometer
    I/O performance Analysis Tool.
    Audience: Developers, Information
    Technology, Science/Research, System
    Administrators. User interface: Win32
    (MS Windows). Progr...
    Download Iometer
  • More »

Linux commands

Ad