DLL's and shared libraries

Browsed through the stuff available for shared libraries. Looks like a
royal pain in the butt to get working.It seems QNX wants people to use
shared libraries but it seems that they don’t want to make it easy to
set up. Can someone tell me how long it took them to create a shared
library and how hard they found it.

What I would really like is a dynamically loaded module that I could
provide to customers as optional packages that could be started long
after the base program is running. If my base code sees that the links
are setup, then additional functionalty is available. Guess I will take
a look at that mmap function and the linker output …

It really isn’t that hard. It definately isn’t as easy as it is in QNX
6.1 (where it is brain dead simple - nothing more than a compiler
option) but in the grand scheme of difficult things, I’d put writing a
4.25 shared lib at a 2 (10 being the most difficult). This is assuming
that you are writing the shared lib in C, if you want a C++ shared lib
in QNX 4.25 then the difficulty level shoots up to an 8 (where 9 is
writing a compiler and 10 is writing a O/S :slight_smile:

-----Original Message-----
From: Dave Allamby [mailto:allambyjdx@cyradisx.com]
Posted At: Tuesday, August 28, 2001 6:56 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: DLL’s and shared libraries


Browsed through the stuff available for shared libraries. Looks like a
royal pain in the butt to get working.It seems QNX wants people to use
shared libraries but it seems that they don’t want to make it easy to
set up. Can someone tell me how long it took them to create a shared
library and how hard they found it.

What I would really like is a dynamically loaded module that I could
provide to customers as optional packages that could be started long
after the base program is running. If my base code sees that the links
are setup, then additional functionalty is available. Guess I will take
a look at that mmap function and the linker output …

“Rennie Allen” <RAllen@csical.com> wrote in message
news:64F00D816A85D51198390050046F80C9A441@exchangecal.hq.csical.com

It really isn’t that hard. It definately isn’t as easy as it is in QNX
6.1 (where it is brain dead simple - nothing more than a compiler
option) but in the grand scheme of difficult things, I’d put writing a
4.25 shared lib at a 2 (10 being the most difficult). This is assuming
that you are writing the shared lib in C, if you want a C++ shared lib
in QNX 4.25 then the difficulty level shoots up to an 8 (where 9 is
writing a compiler and 10 is writing a O/S > :slight_smile:

i guess hello world should be -1, right ? :slight_smile:

// wbr

I am still developing our product using watcom 10.6 and I do no believe there
is a simple switch like there is in gcc for making shared libraries. Is it
stll a 2.


ian zagorskih wrote:

“Rennie Allen” <> RAllen@csical.com> > wrote in message
news:> 64F00D816A85D51198390050046F80C9A441@exchangecal.hq.csical.com> …
It really isn’t that hard. It definately isn’t as easy as it is in QNX
6.1 (where it is brain dead simple - nothing more than a compiler
option) but in the grand scheme of difficult things, I’d put writing a
4.25 shared lib at a 2 (10 being the most difficult). This is assuming
that you are writing the shared lib in C, if you want a C++ shared lib
in QNX 4.25 then the difficulty level shoots up to an 8 (where 9 is
writing a compiler and 10 is writing a O/S > :slight_smile:


i guess hello world should be -1, right ? > :slight_smile:

// wbr

Yes. A command line switch would be a 0 (since there is no special
coding required).

Realistically it will take a couple of days to grok shared libs (and the
implications of the implementation) on QNX4.

-----Original Message-----
From: Dave Allamby [mailto:allambyjdx@cyradisx.com]
Posted At: Thursday, August 30, 2001 3:01 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: Re: DLL’s and shared libraries


I am still developing our product using watcom 10.6 and I do no believe
there
is a simple switch like there is in gcc for making shared libraries. Is
it
stll a 2.


ian zagorskih wrote:

“Rennie Allen” <> RAllen@csical.com> > wrote in message
news:> 64F00D816A85D51198390050046F80C9A441@exchangecal.hq.csical.com> …
It really isn’t that hard. It definately isn’t as easy as it is in
QNX
6.1 (where it is brain dead simple - nothing more than a compiler
option) but in the grand scheme of difficult things, I’d put writing
a
4.25 shared lib at a 2 (10 being the most difficult). This is
assuming
that you are writing the shared lib in C, if you want a C++ shared
lib
in QNX 4.25 then the difficulty level shoots up to an 8 (where 9 is
writing a compiler and 10 is writing a O/S > :slight_smile:


i guess hello world should be -1, right ? > :slight_smile:

// wbr

I looked at the stuff provided in the free download regarding shared
libraries and it was a dogs breakfast. That is what prompted the original
questions. As mentioned earlier as well, what I really am looking for is a
way to dynamically load a module into my program to add enhanced features
without taking down the program. This means I need to do delayed binding
under my control. I will probably take a look at creating an ELF loader
embedded in my application.

Rennie Allen wrote:

Yes. A command line switch would be a 0 (since there is no special
coding required).

Realistically it will take a couple of days to grok shared libs (and the
implications of the implementation) on QNX4.

-----Original Message-----
From: Dave Allamby [mailto:> allambyjdx@cyradisx.com> ]
Posted At: Thursday, August 30, 2001 3:01 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: Re: DLL’s and shared libraries

I am still developing our product using watcom 10.6 and I do no believe
there
is a simple switch like there is in gcc for making shared libraries. Is
it
stll a 2.

ian zagorskih wrote:

“Rennie Allen” <> RAllen@csical.com> > wrote in message
news:> 64F00D816A85D51198390050046F80C9A441@exchangecal.hq.csical.com> …
It really isn’t that hard. It definately isn’t as easy as it is in
QNX
6.1 (where it is brain dead simple - nothing more than a compiler
option) but in the grand scheme of difficult things, I’d put writing
a
4.25 shared lib at a 2 (10 being the most difficult). This is
assuming
that you are writing the shared lib in C, if you want a C++ shared
lib
in QNX 4.25 then the difficulty level shoots up to an 8 (where 9 is
writing a compiler and 10 is writing a O/S > :slight_smile:


i guess hello world should be -1, right ? > :slight_smile:

// wbr

You can do what the Net.* and Dev.* drivers do (qnx_segment_arm).

-----Original Message-----
From: Dave Allamby [mailto:allambyjdx@cyradisx.com]
Posted At: Friday, August 31, 2001 3:40 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: Re: DLL’s and shared libraries


I looked at the stuff provided in the free download regarding shared
libraries and it was a dogs breakfast. That is what prompted the
original
questions. As mentioned earlier as well, what I really am looking for is
a
way to dynamically load a module into my program to add enhanced
features
without taking down the program. This means I need to do delayed binding
under my control. I will probably take a look at creating an ELF loader
embedded in my application.

Rennie Allen wrote:

Yes. A command line switch would be a 0 (since there is no special
coding required).

Realistically it will take a couple of days to grok shared libs (and
the
implications of the implementation) on QNX4.

-----Original Message-----
From: Dave Allamby [mailto:> allambyjdx@cyradisx.com> ]
Posted At: Thursday, August 30, 2001 3:01 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: Re: DLL’s and shared libraries

I am still developing our product using watcom 10.6 and I do no
believe
there
is a simple switch like there is in gcc for making shared libraries.
Is
it
stll a 2.

ian zagorskih wrote:

“Rennie Allen” <> RAllen@csical.com> > wrote in message

news:> 64F00D816A85D51198390050046F80C9A441@exchangecal.hq.csical.com> …
It really isn’t that hard. It definately isn’t as easy as it is
in
QNX
6.1 (where it is brain dead simple - nothing more than a compiler
option) but in the grand scheme of difficult things, I’d put
writing
a
4.25 shared lib at a 2 (10 being the most difficult). This is
assuming
that you are writing the shared lib in C, if you want a C++ shared
lib
in QNX 4.25 then the difficulty level shoots up to an 8 (where 9
is
writing a compiler and 10 is writing a O/S > :slight_smile:


i guess hello world should be -1, right ? > :slight_smile:

// wbr

Rennie,

This looks interesting. I will investigate this further. Thanks for the
direction.

Dave


Rennie Allen wrote:

You can do what the Net.* and Dev.* drivers do (qnx_segment_arm).

-----Original Message-----
From: Dave Allamby [mailto:> allambyjdx@cyradisx.com> ]
Posted At: Friday, August 31, 2001 3:40 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: Re: DLL’s and shared libraries

I looked at the stuff provided in the free download regarding shared
libraries and it was a dogs breakfast. That is what prompted the
original
questions. As mentioned earlier as well, what I really am looking for is
a
way to dynamically load a module into my program to add enhanced
features
without taking down the program. This means I need to do delayed binding
under my control. I will probably take a look at creating an ELF loader
embedded in my application.

Rennie Allen wrote:

Yes. A command line switch would be a 0 (since there is no special
coding required).

Realistically it will take a couple of days to grok shared libs (and
the
implications of the implementation) on QNX4.

-----Original Message-----
From: Dave Allamby [mailto:> allambyjdx@cyradisx.com> ]
Posted At: Thursday, August 30, 2001 3:01 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: Re: DLL’s and shared libraries

I am still developing our product using watcom 10.6 and I do no
believe
there
is a simple switch like there is in gcc for making shared libraries.
Is
it
stll a 2.

ian zagorskih wrote:

“Rennie Allen” <> RAllen@csical.com> > wrote in message

news:> 64F00D816A85D51198390050046F80C9A441@exchangecal.hq.csical.com> …
It really isn’t that hard. It definately isn’t as easy as it is
in
QNX
6.1 (where it is brain dead simple - nothing more than a compiler
option) but in the grand scheme of difficult things, I’d put
writing
a
4.25 shared lib at a 2 (10 being the most difficult). This is
assuming
that you are writing the shared lib in C, if you want a C++ shared
lib
in QNX 4.25 then the difficulty level shoots up to an 8 (where 9
is
writing a compiler and 10 is writing a O/S > :slight_smile:


i guess hello world should be -1, right ? > :slight_smile:

// wbr

Dave Allamby <allambyjdx@cyradisx.com> writes:

I looked at the stuff provided in the free download regarding shared
libraries and it was a dogs breakfast. That is what prompted the
original questions. As mentioned earlier as well, what I really am
looking for is a way to dynamically load a module into my program to
add enhanced features without taking down the program. This means I
need to do delayed binding under my control. I will probably take a
look at creating an ELF loader embedded in my application.

QNX shared libraries won’t work for you then. We wrote a dynamic ELF
loader for QNX4. It was a lot of work, but it is possible. You will
need the omf2elf executable sitting somewhere in the QUICS /usr/free
directory.

Cheers,
Andrew


Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N 6S2
Email: andrew@cogent.ca WWW: http://www.cogent.ca

Andrew,

Thanks for the info. Took a look at some of the stuff on the web for elf
loading.
Lot of work is right on the mark, but I think it is worth it.

Dave


Andrew Thomas wrote:

Dave Allamby <> allambyjdx@cyradisx.com> > writes:
I looked at the stuff provided in the free download regarding shared
libraries and it was a dogs breakfast. That is what prompted the
original questions. As mentioned earlier as well, what I really am
looking for is a way to dynamically load a module into my program to
add enhanced features without taking down the program. This means I
need to do delayed binding under my control. I will probably take a
look at creating an ELF loader embedded in my application.

QNX shared libraries won’t work for you then. We wrote a dynamic ELF
loader for QNX4. It was a lot of work, but it is possible. You will
need the omf2elf executable sitting somewhere in the QUICS /usr/free
directory.

Cheers,
Andrew


Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N 6S2
Email: > andrew@cogent.ca > WWW: > http://www.cogent.ca

OK, doing this is a 7 (or more :slight_smile:

I would question whether it is worth the effort at this point given that
QSSL has end-of-lifed QNX4. Andrew did this some time ago (years ago)
IIRC, it may have been worth it at that time.

-----Original Message-----
From: Dave Allamby [mailto:allambyjdx@cyradisx.com]
Posted At: Monday, September 10, 2001 6:39 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: Re: DLL’s and shared libraries


Andrew,

Thanks for the info. Took a look at some of the stuff on the web for elf
loading.
Lot of work is right on the mark, but I think it is worth it.

Dave


Andrew Thomas wrote:

Dave Allamby <> allambyjdx@cyradisx.com> > writes:
I looked at the stuff provided in the free download regarding shared
libraries and it was a dogs breakfast. That is what prompted the
original questions. As mentioned earlier as well, what I really am
looking for is a way to dynamically load a module into my program to
add enhanced features without taking down the program. This means I
need to do delayed binding under my control. I will probably take a
look at creating an ELF loader embedded in my application.

QNX shared libraries won’t work for you then. We wrote a dynamic ELF
loader for QNX4. It was a lot of work, but it is possible. You will
need the omf2elf executable sitting somewhere in the QUICS /usr/free
directory.

Cheers,
Andrew


Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N
6S2
Email: > andrew@cogent.ca > WWW: > http://www.cogent.ca

Does Neutrino have a way for me to load a module into my program? Have not
seen one, so I would suspect that I would simple need to port the loader to
Neutrino (along with the rest of my code).


Rennie Allen wrote:

OK, doing this is a 7 (or more > :slight_smile:

I would question whether it is worth the effort at this point given that
QSSL has end-of-lifed QNX4. Andrew did this some time ago (years ago)
IIRC, it may have been worth it at that time.

-----Original Message-----
From: Dave Allamby [mailto:> allambyjdx@cyradisx.com> ]
Posted At: Monday, September 10, 2001 6:39 PM
Posted To: devtools
Conversation: DLL’s and shared libraries
Subject: Re: DLL’s and shared libraries

Andrew,

Thanks for the info. Took a look at some of the stuff on the web for elf
loading.
Lot of work is right on the mark, but I think it is worth it.

Dave

Andrew Thomas wrote:

Dave Allamby <> allambyjdx@cyradisx.com> > writes:
I looked at the stuff provided in the free download regarding shared
libraries and it was a dogs breakfast. That is what prompted the
original questions. As mentioned earlier as well, what I really am
looking for is a way to dynamically load a module into my program to
add enhanced features without taking down the program. This means I
need to do delayed binding under my control. I will probably take a
look at creating an ELF loader embedded in my application.

QNX shared libraries won’t work for you then. We wrote a dynamic ELF
loader for QNX4. It was a lot of work, but it is possible. You will
need the omf2elf executable sitting somewhere in the QUICS /usr/free
directory.

Cheers,
Andrew


Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N
6S2
Email: > andrew@cogent.ca > WWW: > http://www.cogent.ca

Dave Allamby <allambyjdx@cyradisx.com> writes:

Does Neutrino have a way for me to load a module into my program? Have not
seen one, so I would suspect that I would simple need to port the loader to
Neutrino (along with the rest of my code).

Neutrino uses “real” shared objects. They support dlopen, dlclose,
etc., just the same as you would expect from Linux. Dynamically
loading modules into your program in Neutrino is easy, and supported
directly by the OS and tools.

Andrew


Andrew Thomas, President, Cogent Real-Time Systems Inc.
2430 Meadowpine Boulevard, Suite 105, Mississauga, Ontario, Canada L5N 6S2
Email: andrew@cogent.ca WWW: http://www.cogent.ca

Previously, Andrew Thomas wrote in qdn.public.qnx4.devtools:

Dave Allamby <> allambyjdx@cyradisx.com> > writes:

Does Neutrino have a way for me to load a module into my program? Have not
seen one, so I would suspect that I would simple need to port the loader to
Neutrino (along with the rest of my code).

Neutrino uses “real” shared objects. They support dlopen, dlclose,
etc., just the same as you would expect from Linux. Dynamically
loading modules into your program in Neutrino is easy, and supported
directly by the OS and tools.

I’ve done this recently. It works great, it’s easy as 3.141, it’s a beautiful thing.

The only caveat is that, unlike most systems, NTO doesn’t remember the pathname along with the soname, so you’d have trouble loading ‘/dir2/foo.so’ after loading ‘/dir1/foo.so’.


Cheers - Tony ‘Nicoya’ Mantler :slight_smile:


Tony Mantler | Proud ---- Days since the last
QNX Consulting | of our | 22 |
tony@astra.mb.ca | Record ---- “Gerbil Incident”

Tony Mantler <tony@astra.mb.ca> wrote:

Previously, Andrew Thomas wrote in qdn.public.qnx4.devtools:
Dave Allamby <> allambyjdx@cyradisx.com> > writes:

Does Neutrino have a way for me to load a module into my program? Have not
seen one, so I would suspect that I would simple need to port the loader to
Neutrino (along with the rest of my code).

Neutrino uses “real” shared objects. They support dlopen, dlclose,
etc., just the same as you would expect from Linux. Dynamically
loading modules into your program in Neutrino is easy, and supported
directly by the OS and tools.

I’ve done this recently. It works great, it’s easy as 3.141, it’s a beautiful thing.

The only caveat is that, unlike most systems, NTO doesn’t remember the pathname along with the soname, so you’d have trouble loading ‘/dir2/foo.so’ after loading ‘/dir1/foo.so’.

There should be some information (namely device and inode)
information recorded so that you can do this. If you are
finding that this is not the case then a bug report (and
a simple test case if possible) are much appreciated so that
we can fix it for the next release.

If nothing else, drop me a mail message thomasf@qnx.com
with the information.

Thomas

Thomas (toe-mah) Fletcher QNX Software Systems
thomasf@qnx.com Neutrino Development Group
(613)-591-0931 http://www.qnx.com/~thomasf