alsa-devel.alsa-project.org archive mirror
 help / color / mirror / Atom feed
* ALSA hooks: dlopen failed: snd_dlsym_start: symbol not found
@ 2016-08-26  2:11 Jörg Krause
  0 siblings, 0 replies; only message in thread
From: Jörg Krause @ 2016-08-26  2:11 UTC (permalink / raw)
  To: alsa-devel

Hi,

I am trying to build a custom hook library. The minimal hook is:

    #include <alsa/asoundlib.h>

    int _snd_pcm_hook_audio_status_install(snd_pcm_t *pcm, snd_config_t
    *conf)
    {
    	    return 0;
    }
    SND_DLSYM_BUILD_VERSION(_snd_pcm_hook_audio_status_install,
    SND_CONFIG_DLSYM_VERSION_HOOK);

I compile this as a shared library:

    $(CC) -fPIC -lasound -shared -Wl,-soname,lib$(NAME).so $^ -o $@

If I try to load this library using aplay I get the following error:

    dlopen failed: Error relocating /usr/lib/alsa-lib/libaudiostatus.so: 
    snd_dlsym_start: symbol not found

This is the output of the preprocessor:

    int _snd_pcm_hook_audio_status_install(snd_pcm_t *pcm, snd_config_t
    *conf)
    {
     return 0;
    }
    static struct snd_dlsym_link
    _snd_dlsym__snd_pcm_hook_audio_status_install_dlsym_config_hook_001;
    void
    _snd_dlsym_constructor__snd_pcm_hook_audio_status_install_dlsym_conf
    ig_hook_001 (void) __attribute__ ((constructor));
    void
    _snd_dlsym_constructor__snd_pcm_hook_audio_status_install_dlsym_conf
    ig_hook_001 (void) {
    	    _snd_dlsym__snd_pcm_hook_audio_status_install_dlsym_config_hook
    _001.next = snd_dlsym_start;
    	    _snd_dlsym__snd_pcm_hook_audio_status_install_dlsym_config_hook
    _001.dlsym_name = "_snd_pcm_hook_audio_status_install";
    	    _snd_dlsym__snd_pcm_hook_audio_status_install_dlsym_config_hook
    _001.dlsym_ptr = (void *)&_snd_pcm_hook_audio_status_install;
    	    snd_dlsym_start =
    &_snd_dlsym__snd_pcm_hook_audio_status_install_dlsym_config_hook_001
    ;
    };

What do I miss?

Best regards
Jörg Krause


_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-08-26  2:12 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-08-26  2:11 ALSA hooks: dlopen failed: snd_dlsym_start: symbol not found Jörg Krause

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).