473,387 Members | 1,536 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Complicated linking problem

Hello all,

I want to distribute a shared library (lets call it "parent.so"), which,
in turn, is used to create shared libs by invoking the GNU linker (lets
call these shared libs "child.so").

When creating "child.so", some code which needs to be incorporated into
each "child.so" comes from "parent.so" itself. I fully control how
"parent.so" is built, but the problem is that I want to strip all
symbols from "parent.so" before distribution.

I understand that in order to perform the link step for creating a
"child.so", the linker needs to know at which locations in parent.so
certain symbols reside. If "parent.so" itself doesn't have this
information in a regular way,

Is there any (possibly wild) way to inform the linker about what parts
of "parent.so" need to be linked with "child.so", if that information
cannot come the regular way from "parent.so" itself?

I've been looking into command line options to ld, and some of them seem
to come close to what I might need (e.g. some let you specify symbols,
some of them let you specify other files that have symbol information,
....). But to be honest, I don't completely understand many of them.

I have been thinking about:
- using the link map from the link process that generated "parent.so" as
a source of information about the location of certain symbols;
- somehow using the linker command language;
- ...

Being unfamiliar with details of the linking process, and not fully
understanding the command line options, let alone the possibilities that
the linker command language offers, I'm stuck.

I'd appreciate very much if someone pointed me to possibly feasible ways
if these exists; or otherwise be explicit if there is definitely no way
to do what I want.
Thanks in advance,

Erik Leunissen
--
leunissen@ nl | Merge the left part of these two lines into one,
e. hccnet. | respecting a character's position in a line.

Dec 9 '05 #1
4 1293
>I want to distribute a shared library (lets call it "parent.so"), which,
in turn, is used to create shared libs by invoking the GNU linker (lets
call these shared libs "child.so").
Used *BY WHOM*? You or the thief who is your customer?
When creating "child.so", some code which needs to be incorporated into
each "child.so" comes from "parent.so" itself. I fully control how
"parent.so" is built, but the problem is that I want to strip all
symbols from "parent.so" before distribution.
Why? It's obvious you think your customers are thieves, so why
sell to them at all?

A shared library is unusable as a shared library without any symbols.
If it is your intention that parent.so be used *only* to create
child.so, the information has to be there somewhere for child.so
to function.
I understand that in order to perform the link step for creating a
"child.so", the linker needs to know at which locations in parent.so
certain symbols reside. If "parent.so" itself doesn't have this
information in a regular way,
If you provide this information in *ANY* way, the thief who is your
customer will have it. So why go through all this grief?
I believe if you provide this information in the form of a link
map or similar, it is possible for the customer to relink parent.so
and put back the symbols so they are visible in the normal way.

It is possible to strip symbols down to the minimum needed to
make the library function, perhaps only the external function
call entry points. See the --retain-symbols-file <filename>
option. You give it a list of necessary symbols, one to a line;
it deletes all the others. Possibly only the external entry
points for functions are required, but if you have global data,
some of that might be needed also.
Is there any (possibly wild) way to inform the linker about what parts
of "parent.so" need to be linked with "child.so", if that information
cannot come the regular way from "parent.so" itself?
If you are providing this information to the thief to feed to the
GNU linker, you are providing the information to the thief. Why
is providing it via some obscure means an improvement on anything?
I've been looking into command line options to ld, and some of them seem
to come close to what I might need (e.g. some let you specify symbols,
some of them let you specify other files that have symbol information,
...). But to be honest, I don't completely understand many of them. I have been thinking about:
- using the link map from the link process that generated "parent.so" as
a source of information about the location of certain symbols;
- somehow using the linker command language;
- ...

Being unfamiliar with details of the linking process, and not fully
understanding the command line options, let alone the possibilities that
the linker command language offers, I'm stuck.

I'd appreciate very much if someone pointed me to possibly feasible ways
if these exists; or otherwise be explicit if there is definitely no way
to do what I want.


If you don't want the theives to get your program, DON'T SELL IT!

Gordon L. Burditt
Dec 9 '05 #2

"Gordon Burditt" <go***********@burditt.org> wrote in message
news:11*************@corp.supernews.com...
I want to distribute a shared library (lets call it "parent.so"), which,
in turn, is used to create shared libs by invoking the GNU linker (lets
call these shared libs "child.so").


Used *BY WHOM*? You or the thief who is your customer?
When creating "child.so", some code which needs to be incorporated into
each "child.so" comes from "parent.so" itself. I fully control how
"parent.so" is built, but the problem is that I want to strip all
symbols from "parent.so" before distribution.


Why? It's obvious you think your customers are thieves, so why
sell to them at all?

A shared library is unusable as a shared library without any symbols.
If it is your intention that parent.so be used *only* to create
child.so, the information has to be there somewhere for child.so
to function.
I understand that in order to perform the link step for creating a
"child.so", the linker needs to know at which locations in parent.so
certain symbols reside. If "parent.so" itself doesn't have this
information in a regular way,


If you provide this information in *ANY* way, the thief who is your
customer will have it. So why go through all this grief?
I believe if you provide this information in the form of a link
map or similar, it is possible for the customer to relink parent.so
and put back the symbols so they are visible in the normal way.

It is possible to strip symbols down to the minimum needed to
make the library function, perhaps only the external function
call entry points. See the --retain-symbols-file <filename>
option. You give it a list of necessary symbols, one to a line;
it deletes all the others. Possibly only the external entry
points for functions are required, but if you have global data,
some of that might be needed also.
Is there any (possibly wild) way to inform the linker about what parts
of "parent.so" need to be linked with "child.so", if that information
cannot come the regular way from "parent.so" itself?


If you are providing this information to the thief to feed to the
GNU linker, you are providing the information to the thief. Why
is providing it via some obscure means an improvement on anything?
I've been looking into command line options to ld, and some of them seem
to come close to what I might need (e.g. some let you specify symbols,
some of them let you specify other files that have symbol information,
...). But to be honest, I don't completely understand many of them.

I have been thinking about:
- using the link map from the link process that generated "parent.so" as
a source of information about the location of certain symbols;
- somehow using the linker command language;
- ...

Being unfamiliar with details of the linking process, and not fully
understanding the command line options, let alone the possibilities that
the linker command language offers, I'm stuck.

I'd appreciate very much if someone pointed me to possibly feasible ways
if these exists; or otherwise be explicit if there is definitely no way
to do what I want.


If you don't want the theives to get your program, DON'T SELL IT!

Gordon L. Burditt


While to some degree I concur with GLB. Some things fall into the category
of "locks keep honest men honest, and thieves find another home."

barry

Dec 9 '05 #3
Gordon Burditt wrote:

If you provide this information in *ANY* way, the thief who is your
customer will have it. So why go through all this grief?
I believe if you provide this information in the form of a link
map or similar, it is possible for the customer to relink parent.so
and put back the symbols so they are visible in the normal way.

I do not intend to provide the necessary information to the user. I do
intend to provide the information to the the linker program. The idea is
that the linker is called without user intervention by an application
that I provide. Since I build the application myself, I believe to have
much more control over the linker invocation than if I were to leave the
invocation directly to the user.

It is possible to strip symbols down to the minimum needed to
make the library function, perhaps only the external function
call entry points. See the --retain-symbols-file <filename>
option. You give it a list of necessary symbols, one to a line;
it deletes all the others. Possibly only the external entry
points for functions are required, but if you have global data,
some of that might be needed also.

thanks
Is there any (possibly wild) way to inform the linker about what parts
of "parent.so" need to be linked with "child.so", if that information
cannot come the regular way from "parent.so" itself?

If you are providing this information to the thief to feed to the
GNU linker, you are providing the information to the thief. Why
is providing it via some obscure means an improvement on anything?


see explanation above, please.

I've been looking into command line options to ld, and some of them seem
to come close to what I might need (e.g. some let you specify symbols,
some of them let you specify other files that have symbol information,
...). But to be honest, I don't completely understand many of them.


I have been thinking about:
- using the link map from the link process that generated "parent.so" as
a source of information about the location of certain symbols;
- somehow using the linker command language;
- ...

Being unfamiliar with details of the linking process, and not fully
understanding the command line options, let alone the possibilities that
the linker command language offers, I'm stuck.

I'd appreciate very much if someone pointed me to possibly feasible ways
if these exists; or otherwise be explicit if there is definitely no way
to do what I want.

If you don't want the theives to get your program, DON'T SELL IT!

Gordon L. Burditt


--
leunissen@ nl | Merge the left part of these two lines into one,
e. hccnet. | respecting a character's position in a line.

Dec 10 '05 #4
On Sat, 10 Dec 2005 10:10:15 +0100, in comp.lang.c , Erik Leunissen
<lo**@the.footer.invalid> wrote:
Gordon Burditt wrote:

If you provide this information in *ANY* way, the thief who is your
customer will have it. So why go through all this grief?
I believe if you provide this information in the form of a link
map or similar, it is possible for the customer to relink parent.so
and put back the symbols so they are visible in the normal way.


I do not intend to provide the necessary information to the user. I do
intend to provide the information to the the linker program. The idea is
that the linker is called without user intervention by an application
that I provide. Since I build the application myself, I believe to have
much more control over the linker invocation than if I were to leave the
invocation directly to the user.


I think Gordon's point was that no matter how many levels of
indirection you put this through, the CD or whatever that you send
your customer will have to contain the linker and the information it
needs. So your customer has it.

As has been said already, if you don't want thieves to have your
software, don't make it available to customers...

----== Posted via Newsfeeds.Com - Unlimited-Unrestricted-Secure Usenet News==----
http://www.newsfeeds.com The #1 Newsgroup Service in the World! 120,000+ Newsgroups
----= East and West-Coast Server Farms - Total Privacy via Encryption =----
Dec 10 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Wolfgang | last post by:
I have a problem with linking my CPP Code under a irix6 machine (sgi, UNIX). In my CPP code I use some Functions which are written in Python. So its a kind of CPP wrapper for my Python functions In...
0
by: gasturbtec | last post by:
please help im new at access programming and i just got this project dropped in my lap because the old programmer quit. i've been doing ok so far but now i need to add code to an existing database...
18
by: Mark P | last post by:
I have a bit of vb code that uses Tables.Append to programatically link tables from Oracle and DB2 datasources. The problem I am having on some client machines is that the link will take anywhere...
17
by: Mitas Nikos | last post by:
I am trying to use the library conio2 and though I have managed with a few relatively simple examples when i try to compile a program which conio's function clrscr is not in main() i get an error...
1
by: buchalino | last post by:
Hi Guys, Please can someone help me, I am having a linking problem . I am writing a socket program, the problem is just the linking . I am using VC++ In the process of the problem, I...
5
by: news.microsoft.com | last post by:
We have recently upgraded from VS2002 to VS2005 and I'm having a problem with the linker always performing a full link even though nothing has changed. In searching the newsgroups I found that I...
13
by: 7stud | last post by:
test1.py: -------------------- import shelve s = shelve.open("/Users/me/2testing/dir1/aaa.txt") s = "red" s.close() --------output:------ $ python test1.py
0
by: xieml2007 | last post by:
Dear Madam or Sir, I encountered one problem which is quite similiar to the discussions launched at the web site: http://www.thescripts.com/forum/thread280324.html
4
by: naveenmurthy | last post by:
Hello All, I have created a .mht file in following format. 1. The .mht file contains following htmls. a. MHTLinkingProblem.html b. Left.html c. Right.html d. Start.html
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.