Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #2888

Re: .SO files

From BGB <cr88192@hotmail.com>
Newsgroups comp.programming
Subject Re: .SO files
Date 2013-01-22 15:19 -0600
Organization albasani.net
Message-ID <kdmvsc$mkg$1@news.albasani.net> (permalink)
References <54f17a5a-5add-4402-93fa-03a5af4b7dd1@googlegroups.com>

Show all headers | View raw


On 1/22/2013 9:00 AM, bob wrote:
> Can someone help me understand .SO files?
>
> Are these basically the Linux version of DLLs?
>

more or less.

> Are there any utilities to see what functions exist in a .SO file?
>

objdump


they serve basically a similar role, but there are differences:
DLLs use the PE/COFF file-format, SOs use ELF;
DLLs are searched for using PATH, SOs in specific locations;
...

on Windows, it is typical for a person to access a DLL via 
"LoadLibrary()" and "GetProcAddress()".

whereas, on Linux, it is "dlopen()" and "dlsym()".

but, in general, they are similar enough to where most differences can 
be glossed over with a few #ifdef's.


the searching in specific locations is kind of annoying IMO, since it 
requires compiling with special options to make the loader check in the 
same directory in the program for its SOs, which is sort of a "why isn't 
this the default behavior?!" issue (or at least a shorter command-line 
option would have been nice, like "--rpathcwd" or something).


in my case, when dynamically loading SOs by name (in my OS wrapper 
code), there is some code which iteratively probes various locations to 
search for DLLs/SOs, similar to its own sort of path.

for example:
appdir/resource_foo/
appdir/resource/
appdir/
...


well, that, and I have my own funkiness for embedding files (typically 
script code and metadata) into both DLLs and SOs.

it is an idea sort of like a JAR stuffed into an DLL, except using a 
hierarchical WAD variant, rather than a ZIP-based package format 
(intentional, for various reasons).

then one can fetch things like script code and bytecode, VM metadata, 
... from files embedded within the DLL or SO.


yes, ZIP-based package formats are popular, but have a big annoyance, 
namely apps being like "hey, its contents look like a ZIP, but I don't 
recognize the extension, so I will rename it for you".

so, one ends up with lots of JAR / ODT / DOCX / ... files all 
"conviniently" renamed to have a ZIP extension (and people whining about 
"I try to download this JAR/ODT/..." and all I get is a ZIP file with 
lots of little files in it). little to say it wouldn't also happen with 
EXEs and DLLs.

so, in my case, I chose a custom packaging. WAD was an obvious-enough 
choice to base the design off of.


actually, it is sort of like .NET CLR images:
they are just sort of crudely tacked onto the end of an EXE or DLL 
PE/COFF image;
but, for the most part, their existence is hidden and ignorable (users 
don't care, the OS loader doesn't care, ... then the VM notices images 
that contain data it cares about).


ironically, it doesn't much effect the size of SOs, because it seems my 
VM image data is typically dwarfed by the DWARF data.


or such...

Back to comp.programming | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

.SO files bob <bob@coolfone.comze.com> - 2013-01-22 07:00 -0800
  Re: .SO files Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-01-22 15:26 +0000
  Re: .SO files "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-01-22 16:37 +0100
  Re: .SO files "BartC" <bc@freeuk.com> - 2013-01-22 17:42 +0000
    Re: .SO files Noob <root@127.0.0.1> - 2013-02-08 10:41 +0100
      Re: .SO files Robert Wessel <robertwessel2@yahoo.com> - 2013-02-08 04:13 -0600
      Re: .SO files "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-02-08 12:09 +0100
      Re: .SO files "BartC" <bc@freeuk.com> - 2013-02-08 18:13 +0000
        Re: .SO files Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-02-08 21:20 +0000
          Re: .SO files "BartC" <bc@freeuk.com> - 2013-02-08 23:30 +0000
            Re: .SO files Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-02-09 02:32 +0000
              Re: .SO files "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-02-09 09:27 +0100
                Re: .SO files "Chris Uppal" <chris.uppal@metagnostic.REMOVE-THIS.org> - 2013-02-09 10:09 +0000
                Re: .SO files Ben Bacarisse <ben.usenet@bsb.me.uk> - 2013-02-09 12:11 +0000
                Re: .SO files "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2013-02-09 14:15 +0100
                Re: .SO files "BartC" <bc@freeuk.com> - 2013-02-09 14:56 +0000
                Re: .SO files clarcky297@gmail.com - 2013-02-13 07:30 -0800
              Re: .SO files "BartC" <bc@freeuk.com> - 2013-02-09 14:48 +0000
  Re: .SO files BGB <cr88192@hotmail.com> - 2013-01-22 15:19 -0600
  Re: .SO files Ian Collins <ian-news@hotmail.com> - 2013-01-23 10:25 +1300

csiph-web