arcane question 
Author Message
 arcane question

I've been poking around in source code and found, in
$popsrc/extern_symbols.p, lines 28-30,

exload dl [^DL_LIB]
        lconstant exload_dummy;         ;;; anything will do
endexload;

They are preceded by the comment
/*      dummy external load to force linking against the dynamic linker
                library
and DL_LIB has been assigned the value 'ldl' in $popsrc/external.ph.

Can someone explain to me what is being achieved here?  

The lines won't load in ordinary pop11 - you get an error message

Error: can't find value for symbol exload_dummy

That's not a problem in itself because the file is meant to be compiled
with popc rather than the normal pop11 compiler.  But what is getting
added to the pop11 binary as the result of trying to reference a
non-existent symbol in the dynamic linker
library?  And at what stage of compiling/linking is the dummy reference
attempted?

Thanks for any enlightenment you can provide.

Stephen Isard



Sat, 03 Jan 2004 00:32:49 GMT  
 arcane question
Steve,

Here's a guess: this code is a neat way to link the dynamic linker library
into poplog, so that the runtlime system can do dynamic linking. At runtime
this is a bit perverse (because you would need the dynamic linker already
in place to perform the link) and also fails because it tries to assign a
reference to exload_dummy, as you discovered. At build time, however, the
link doesn't get done straight away - it just creates additional link data
that is eventually linked by the *static* link process. In addition,
because exload_dummy is lexical and not referenced elsewhere, I would guess
that no dereferencing code is ever generated for it, so the system never
notices that it wasn't found in the link.  If this guess is right, then the
offending code should be wrapped in #_IF DEF POPC (or whatever the test for
POPC compilation is..)

Roger

Quote:

> I've been poking around in source code and found, in
> $popsrc/extern_symbols.p, lines 28-30,

> exload dl [^DL_LIB]
>         lconstant exload_dummy;         ;;; anything will do
> endexload;

> They are preceded by the comment
> /*      dummy external load to force linking against the dynamic linker
>                 library
> and DL_LIB has been assigned the value 'ldl' in $popsrc/external.ph.

> Can someone explain to me what is being achieved here?

> The lines won't load in ordinary pop11 - you get an error message

> Error: can't find value for symbol exload_dummy

> That's not a problem in itself because the file is meant to be compiled
> with popc rather than the normal pop11 compiler.  But what is getting
> added to the pop11 binary as the result of trying to reference a
> non-existent symbol in the dynamic linker
> library?  And at what stage of compiling/linking is the dummy reference
> attempted?

> Thanks for any enlightenment you can provide.

> Stephen Isard



Sat, 03 Jan 2004 16:38:42 GMT  
 arcane question

Quote:

> Here's a guess: this code is a neat way to link the dynamic linker library
> into poplog, so that the runtlime system can do dynamic linking.

Right. I was thinking from the comment that it must be something on
those lines.

Quote:
> At build time, however, the
> link doesn't get done straight away - it just creates additional link data
> that is eventually linked by the *static* link process.

Is that going to be the step carried out by the file in
$popsys/poplink_cmnd?

Quote:
> In addition,
> because exload_dummy is lexical and not referenced elsewhere, I would guess
> that no dereferencing code is ever generated for it, so the system never
> notices that it wasn't found in the link.

Hmm.  I guess I'd need to look into what popc actually produces.

Quote:
> If this guess is right, then the
> offending code should be wrapped in #_IF DEF POPC (or whatever the test for
> POPC compilation is..)

I didn't actually want to compile it in pop11.  I'm just trying to
understand why my original libc5 poplog had the problem it did with
external loading, and why the problem went away when I relinked with -
as far as I can see - the same libraries, but under a different kernel.

Thanks very much for the information, Roger.

Steve



Sun, 04 Jan 2004 00:26:32 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. A dangling comma: Arcane or just plain wrong?

2. SOS on arcane "Corrupt File (Zero length)" problem

3. Questions-Questions-Questions-Answers-Answers

4. Question(Questions, questions...)

5. Newbie Question: Realbasic Question

6. Questions Questions

7. Questions and more questions...

8. Browse Question / Report question

9. ***Data buffering question. Long post, lots of questions

10. questions, questions!

11. Questions, questions!

12. MicroWorlds Pro "QUESTION Set Size" question

 

 
Powered by phpBB® Forum Software