new_perl
new_perl

Reputation: 7735

How's DynaLoader's c library loaded?

We know this module's function is Dynamically load C libraries into Perl code .

But how's its own c library loaded into Perl in the first place?

I judge it should have its own c library because I don't find the function dl_load_file right inside DynaLoader.pm,so it must be in some c library...

Upvotes: 4

Views: 459

Answers (1)

Alex
Alex

Reputation: 5893

Dynaloader is statically linked to Perl (managed by Configure), so that it is always available. It wouldn't work very well if it had to be available itself to load itself.

The source for Dynloader is at /ext/Dynaloader/ in the Perl distribution, which contains a number of different implementations of dl_load_file for the various architectures on which Perl might run.

So yes, dl_load_file is in a library, but it ends up inside perl when perl gets built.

Upvotes: 7

Related Questions