Re: dlz-bdbhpt-dynamic - a dlopen bdbhpt DLZ driver

Mark Goldfinch <[email protected]> Mon, 16 Jul 2012 20:21:51 +1200
Newsgroups gmane.network.dns.bind9.dlz
Message-ID <CAK7eGc29jUC3k3yg+h9xh2K1XCpEoozjTfrxyYDZW=jybea-Qw@mail.gmail.com>
--===============0141648799552835981==
Content-Type: multipart/alternative; boundary=047d7b15ae552cba9304c4ee1f32

--047d7b15ae552cba9304c4ee1f32
Content-Type: text/plain; charset=ISO-8859-1

Hi Jan-Piet,

On 16 July 2012 19:18, Jan-Piet Mens <[email protected]> wrote:

> > Over the weekend I've taken it upon myself to write up a dlopen() capable
> > bdbhpt DLZ driver.
>
> That looks pretty slick.
>

Thanks :-) I'm hoping it ends up being useful.


> I can't for the life of me link the module, though. I'm running on OS/X
> 10.6 and both DLZ example (from BIND 9.9.1-P1 contrib) and my own [1]
> link fine with dlz-minimal (V2).
>
> |   cc -fPIC -g -I. -I/usr/local/BerkeleyDB.4.7/include -shared -o \
> |        dlz_bdbhpt_dynamic.so dlz_bdbhpt_dynamic.c \
> |        -L/usr/local/BerkeleyDB.4.7/lib -ldb
> |   Undefined symbols:
> |     "_dns_sdlz_putnamedrr", referenced from:
> |         _dlz_allnodes in ccHsui8i.o
> |     "_dns_sdlz_putrr", referenced from:
> |         _dlz_lookup in ccHsui8i.o
> |   ld: symbol(s) not found
>
> This must be due to lack of morning coffee...
>

The missing symbols your linker is complaining about are internal ones
generated by the compiler?  Those particular symbols appear to be ones
within the source proceeded by _.

I suspect this is coming about because I'm building the shared object in
one go, and not building the plain object file first.

>From your Makefile:

dlz_lua.so: dlz_lua.o
        $(CC) $(CFLAGS) -shared -o dlz_lua.so dlz_lua.o -L$(LUA) -llua

note the lack of dlz_lua.o definition though.  Where-as from mine:

dlz_bdbhpt_dynamic.so:
        $(CC) $(CFLAGS) -shared -o dlz_bdbhpt_dynamic.so
dlz_bdbhpt_dynamic.c $(BDB_LIBS)

Could you try modifying the Makefile to be:

dlz_bdbhpt_dynamic.so: dlz_bdbhpt_dynamic.o
        $(CC) $(CFLAGS) -shared -o dlz_bdbhpt_dynamic.so
dlz_bdbhpt_dynamic.c $(BDB_LIBS)

to see whether that makes any difference for you?

> * This provides the externally loadable bdbhpt DLZ driver, without
> > * update support
>
> Now, about the last bit of that comment in the source... ;-)
>

Well yes, a working read-only implementation to start with is my first
goal.  If this goes well I may try my hand against some of the other
drivers.

Thanks,
Mark.

--047d7b15ae552cba9304c4ee1f32
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable

Hi Jan-Piet,<br><br><div class=3D"gmail_quote">On 16 July 2012 19:18, Jan-P=
iet Mens <span dir=3D"ltr">&lt;<a href=3D"mailto:[email protected]" targ=
et=3D"_blank">[email protected]</a>&gt;</span> wrote:<br><blockquote cla=
ss=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;pa=
dding-left:1ex">
<div class=3D"im">&gt; Over the weekend I&#39;ve taken it upon myself to wr=
ite up a dlopen() capable<br>
&gt; bdbhpt DLZ driver.<br>
<br>
</div>That looks pretty slick.<br></blockquote><div><br></div><div>Thanks :=
-) I&#39;m hoping it ends up being useful.</div><div>=A0</div><blockquote c=
lass=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;border-left:1px #ccc solid;=
padding-left:1ex">

I can&#39;t for the life of me link the module, though. I&#39;m running on =
OS/X<br>
10.6 and both DLZ example (from BIND 9.9.1-P1 contrib) and my own [1]<br>
link fine with dlz-minimal (V2).<br>
<br>
| =A0 cc -fPIC -g -I. -I/usr/local/BerkeleyDB.4.7/include -shared -o \<br>
| =A0 =A0 =A0 =A0dlz_bdbhpt_dynamic.so dlz_bdbhpt_dynamic.c \<br>
| =A0 =A0 =A0 =A0-L/usr/local/BerkeleyDB.4.7/lib -ldb<br>
| =A0 Undefined symbols:<br>
| =A0 =A0 &quot;_dns_sdlz_putnamedrr&quot;, referenced from:<br>
| =A0 =A0 =A0 =A0 _dlz_allnodes in ccHsui8i.o<br>
| =A0 =A0 &quot;_dns_sdlz_putrr&quot;, referenced from:<br>
| =A0 =A0 =A0 =A0 _dlz_lookup in ccHsui8i.o<br>
| =A0 ld: symbol(s) not found<br>
<br>
This must be due to lack of morning coffee...<br></blockquote><div><br></di=
v><div>The missing symbols your linker is complaining about are internal on=
es generated by the compiler? =A0Those particular symbols appear to be ones=
 within the source=A0proceeded=A0by _.</div>
<div><br></div><div>I suspect this is coming about because I&#39;m building=
 the shared object in one go, and not building the plain object file first.=
</div><div><br></div><div>From your Makefile:=A0</div><br><font face=3D"cou=
rier new, monospace">dlz_lua.so: dlz_lua.o<br>
=A0 =A0 =A0 =A0 $(CC) $(CFLAGS) -shared -o dlz_lua.so dlz_lua.o -L$(LUA) -l=
lua</font></div><div class=3D"gmail_quote"><br>note the lack of dlz_lua.o d=
efinition though. =A0Where-as from mine:</div><div class=3D"gmail_quote"><b=
r></div><div class=3D"gmail_quote">
<div class=3D"gmail_quote"><font face=3D"courier new, monospace">dlz_bdbhpt=
_dynamic.so:</font></div><div class=3D"gmail_quote"><font face=3D"courier n=
ew, monospace">=A0 =A0 =A0 =A0 $(CC) $(CFLAGS) -shared -o dlz_bdbhpt_dynami=
c.so dlz_bdbhpt_dynamic.c $(BDB_LIBS)</font></div>
<div><br></div><div>Could you try modifying the Makefile to be:</div><div><=
br></div><div><div class=3D"gmail_quote"><font face=3D"courier new, monospa=
ce">dlz_bdbhpt_dynamic.so: dlz_bdbhpt_dynamic.o</font></div><div class=3D"g=
mail_quote">
<font face=3D"courier new, monospace">=A0 =A0 =A0 =A0 $(CC) $(CFLAGS) -shar=
ed -o dlz_bdbhpt_dynamic.so dlz_bdbhpt_dynamic.c $(BDB_LIBS)</font></div></=
div><div>=A0</div><div>to see whether that makes any difference for you?</d=
iv><div>
<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex;bord=
er-left:1px #ccc solid;padding-left:1ex">&gt; * This provides the externall=
y loadable bdbhpt DLZ driver, without<br>
&gt; * update support<br>
<br>
Now, about the last bit of that comment in the source... ;-)<br></blockquot=
e><div><br></div><div>Well yes, a working read-only implementation to start=
 with is my first goal. =A0If this goes well I may try my hand against some=
 of the other drivers.</div>
<div><br></div><div>Thanks,</div><div>Mark.=A0</div></div>

--047d7b15ae552cba9304c4ee1f32--


--===============0141648799552835981==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
--===============0141648799552835981==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Bind-dlz-testers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/bind-dlz-testers

--===============0141648799552835981==--