All of lore.kernel.org
 help / color / mirror / Atom feed
From: Laszlo Valko <valko@linux.karinthy.hu>
To: nickolay@protei.ru
Cc: netfilter-devel@lists.netfilter.org
Subject: Re: failed loading SNAT and DNAT library
Date: Thu, 16 Jan 2003 20:12:52 +0100	[thread overview]
Message-ID: <20030116201252.A9728@linux.karinthy.hu> (raw)
In-Reply-To: <20030114184457.A25511@protei.ru>; from nickolay@protei.ru on Tue, Jan 14, 2003 at 06:44:57PM +0300

On Tue, Jan 14, 2003 at 06:44:57PM +0300, nickolay@protei.ru wrote:
> Hi Guys!
> 
> I'm newbe to developing netfilter code and i have some troubles 
> with it. I need to working with SNAT and DNAT target rules in my 
> new project, but when i trying load shared librarys libipt_SNAT.so 
> for SNAT or libipt_DNAT.so for DNAT targets with dlopen(), program
> executing is stopped on dlopen() call with next error:
> /usr/local/lib/iptables/libipt_SNAT.so: undefined symbol: dotted_to_addr.
> Compile step:
> cc iptest.c -ldl -liptc -o myprog

Basically, you would have to export symbols from the main program (myprog)
so that the modules to be loaded can resolve symbols from the libiptc.a

Check out iptables makefiles. There's an extra -rdynamic argument to cc,
which will in turn add -export-dynamic to ld:

       -export-dynamic
              When  creating  an ELF file, add all symbols to the
              dynamic symbol table.  Normally, the dynamic symbol
              table contains only symbols which are used by a dy-
              namic object.  This option is needed for some  uses
              of dlopen.

This should do it for you.

Laszlo

      reply	other threads:[~2003-01-16 19:12 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <20030114141102.14779.87181.Mailman@kashyyyk>
2003-01-14 15:44 ` failed loading SNAT and DNAT library nickolay
2003-01-16 19:12   ` Laszlo Valko [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030116201252.A9728@linux.karinthy.hu \
    --to=valko@linux.karinthy.hu \
    --cc=netfilter-devel@lists.netfilter.org \
    --cc=nickolay@protei.ru \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.