K
Kyle Moffett
I'm writing a PAM module called pam_perl.so, designed to allow me to
call into Perl modules to do PAM auth. I have two test programs,
testauth.pl and testauth.c which act as PAM applications, the first
using Authen:AM and the second using the C interface. When I run
the Perl version I get segfaults, but the C version can't load the
/lib/security/pam_perl.so file because it claims boot_DynaLoader is
undefined. Here is a snippet from make's output
kmoffett@hydrogen:~/projects/pam_perl$ make
[...]
cc -Iinc -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -DPERL_NO_SHORT_NAMES
-Iinc -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -UPERL_NO_SHORT_NAMES
-g -O0 -fPIC -Wall -Werror -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -g
-O0 -fPIC -Wall -Werror -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -o
obj/SHARED_OBJ_pam_perl/config/perlembed.o -c src/config/perlembed.c
[...]
cc -Wl,-E -L/usr/local/lib
/usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
-L/usr/lib/perl/5.8/CORE -lperl -ldl -lm -lpthread -lc -lcrypt
-Wl,--shared -o dst/SHARED_OBJ/pam_perl.so
obj/SHARED_OBJ_pam_perl/config/perlembed.o
obj/SHARED_OBJ_pam_perl/pam_perl.o
[...]
As far as I can tell DynaLoader is being linked into the resultant .so
file, but when I run objdump on it it reports boot_DynaLoader as an
undefined symbol. objdump on the DynaLoader.a file _does_ work,
however, and shows a valid boot_DynaLoader symbol.
Cheers,
Kyle Moffett
call into Perl modules to do PAM auth. I have two test programs,
testauth.pl and testauth.c which act as PAM applications, the first
using Authen:AM and the second using the C interface. When I run
the Perl version I get segfaults, but the C version can't load the
/lib/security/pam_perl.so file because it claims boot_DynaLoader is
undefined. Here is a snippet from make's output
kmoffett@hydrogen:~/projects/pam_perl$ make
[...]
cc -Iinc -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -DPERL_NO_SHORT_NAMES
-Iinc -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS -DDEBIAN
-fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -UPERL_NO_SHORT_NAMES
-g -O0 -fPIC -Wall -Werror -D_REENTRANT -D_GNU_SOURCE
-DTHREADS_HAVE_PIDS -DDEBIAN -fno-strict-aliasing -I/usr/local/include
-D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -g
-O0 -fPIC -Wall -Werror -D_REENTRANT -D_GNU_SOURCE -DTHREADS_HAVE_PIDS
-DDEBIAN -fno-strict-aliasing -I/usr/local/include -D_LARGEFILE_SOURCE
-D_FILE_OFFSET_BITS=64 -I/usr/lib/perl/5.8/CORE -o
obj/SHARED_OBJ_pam_perl/config/perlembed.o -c src/config/perlembed.c
[...]
cc -Wl,-E -L/usr/local/lib
/usr/lib/perl/5.8/auto/DynaLoader/DynaLoader.a
-L/usr/lib/perl/5.8/CORE -lperl -ldl -lm -lpthread -lc -lcrypt
-Wl,--shared -o dst/SHARED_OBJ/pam_perl.so
obj/SHARED_OBJ_pam_perl/config/perlembed.o
obj/SHARED_OBJ_pam_perl/pam_perl.o
[...]
As far as I can tell DynaLoader is being linked into the resultant .so
file, but when I run objdump on it it reports boot_DynaLoader as an
undefined symbol. objdump on the DynaLoader.a file _does_ work,
however, and shows a valid boot_DynaLoader symbol.
Cheers,
Kyle Moffett