473,659 Members | 2,671 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1303
>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
understandin g 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.supe rnews.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
understandin g 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
understandi ng 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.foote r.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
1714
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 my Python Code I use threads to communicate over the network and stuff like this. Compilation and linking are working very well under Windows and Linux with the same code. Under the sgi, UNIX machine some errors occur and I don't no why....
0
2240
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 that is used to connect to other databases and generate reports. below is sample code of how the database does the linking i hope i give you enough info to help me but if not let me know and i will give more. Sub txtShipDataFileSub() Dim...
18
3069
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 from 1 to 3 minutes to link the table. When I manually link the tables,through Access, it takes no time at all. Note that only certain client have the problem, and the problem will sometimes go away. These clients will usually get an ODBC Call...
17
6996
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 from the linker. undefined reference to `clrscr' ld returned 1 exit status I include the conio2.h on top of the file where clrscr() fn is. How do I pass the -lconio parameter when I have multiple files?Isn't it:
1
2238
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 installed the MSDN service pack, but not sure if it has a specific directory to be installed in.
5
2050
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 could add "/test" to the linker options and it would tell me why it was causing it to re-link (full link). This is what I get. Linking... LINK : file alignment: 512, section alignment: 4096 LINK : LINK options changed; performing full link LINK...
13
6494
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
3976
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
8054
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
8427
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8330
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8850
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8523
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
5649
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4175
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4334
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2749
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1975
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.