473,325 Members | 2,785 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,325 software developers and data experts.

OT - Name Mangling software

Folks,

Does any one know of any "name mangling" software that allows standard C
with long names to be linked? Any suggestions for a better place to look? I
have tried putting various searchs into google to no avail.

Dave.
May 10 '06 #1
6 1703
David Wade wrote:

Folks,

Does any one know of any "name mangling" software that allows standard C
with long names to be linked? Any suggestions for a better place to look? I
have tried putting various searchs into google to no avail.


Why do you need to "mangle" the names just because they're "long"?

--
+-------------------------+--------------------+-----------------------------+
| Kenneth J. Brody | www.hvcomputer.com | |
| kenbrody/at\spamcop.net | www.fptech.com | #include <std_disclaimer.h> |
+-------------------------+--------------------+-----------------------------+
Don't e-mail me at: <mailto:Th*************@gmail.com>

May 10 '06 #2


Kenneth Brody wrote On 05/09/06 16:08,:
David Wade wrote:
Folks,

Does any one know of any "name mangling" software that allows standard C
with long names to be linked? Any suggestions for a better place to look? I
have tried putting various searchs into google to no avail.

Why do you need to "mangle" the names just because they're "long"?


The usual reason is that the code uses a set of
external names that clash if merely truncated to the
linker's limit:

int getDescenderHeight(const Font *f);
const char *getDescription(const Font *f);
struct design_t *getDesign(const Font *f);
enum destination getDestination(const Taxi *t);

.... all of which are just `GETDES' to a case-insensitive
six-character linker satisfying the C89 minimal requirement.
What D.W. needs is some kind of tool that collects all these
names and writes a .h file like

#define getDescent GET121
#define getDescription GEN845
#define getDesign GEN126
#define getDestination GEN666

.... that he can then #include everywhere.

It was more than twenty years ago that I last confronted
this problem, and the tool we used was not something pre-
packaged: We just cobbled together a few shell scripts and
a short ad-hoc program. One important advantage was that we
were doing a port from a less-limited system where we were
able to build the program with the full names; this allowed
us to extract the names from the executable with an existing
system utility ("nm") instead of needing to parse the C source.

The worst part, as I recall, wasn't writing the mangler
but trying to use the debugger on the code whose long external
names had all been changed ... A pair of original-to-mangled
and mangled-to-original "dictionaries" helped, but there was
a lot of back-and-forthing just to figure out where to set a
breakpoint. Interpreting a stack trace was painful ... It
helps a little if the mangling preserves some "interesting"
features of the original names. It helps even more if the
mangling doesn't change (much) from day to day. Together,
these two suggest that the mangling should be driven as much
from the name itself as possible, and shouldn't just be a
disguised sequence number or address or some such that has
zero mnemonic value and defeats memorization.

Alas, I'm not aware of a pre-packaged tool that does this
sort of thing. On the other hand, it was a smallish bit of
work to put the tool together, and only the work of a few days
to refine it as far as we thought we could usefully go.

--
Er*********@sun.com

May 10 '06 #3
David Wade wrote:

Does any one know of any "name mangling" software that allows
standard C with long names to be linked? Any suggestions for a
better place to look? I have tried putting various searchs into
google to no avail.


My id2id package can be used to make consistent substitutions over
a set of source files, thus avoiding the problem entirely. If
properly selected the entire process is also reversible. In fact
one of the testing examples converts its own source into something
with only 2 character identifiers, and back again. See:

<http://cbfalconer.home.att.net/download/id2id-20.zip>

--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - GWB 2004-2-8
"If I knew then what I know today, I would still have invaded
Iraq. It was the right decision" - G.W. Bush, 2004-08-02
"This notion that the United States is getting ready to attack
Iran is simply ridiculous. And having said that, all options
are on the table." - George W. Bush, Brussels, 2005-02-22
May 10 '06 #4

"CBFalconer" <cb********@yahoo.com> wrote in message
news:44***************@yahoo.com...
David Wade wrote:

Does any one know of any "name mangling" software that allows
standard C with long names to be linked? Any suggestions for a
better place to look? I have tried putting various searchs into
google to no avail.
My id2id package can be used to make consistent substitutions over
a set of source files, thus avoiding the problem entirely. If
properly selected the entire process is also reversible. In fact
one of the testing examples converts its own source into something
with only 2 character identifiers, and back again. See:

<http://cbfalconer.home.att.net/download/id2id-20.zip>>


That looks like one starting point, but you really need to know what ID's
are in use, which is not always easier. Why is this better than the
"#define" approach I have been using so far?
--
"I'm a war president. I make decisions here in the Oval Office
in foreign policy matters with war on my mind." - GWB 2004-2-8
"If I knew then what I know today, I would still have invaded
Iraq. It was the right decision" - G.W. Bush, 2004-08-02
"This notion that the United States is getting ready to attack
Iran is simply ridiculous. And having said that, all options
are on the table." - George W. Bush, Brussels, 2005-02-22

May 10 '06 #5
David Wade wrote:
"CBFalconer" <cb********@yahoo.com> wrote in message
David Wade wrote:

Does any one know of any "name mangling" software that allows
standard C with long names to be linked? Any suggestions for a
better place to look? I have tried putting various searchs into
google to no avail.


My id2id package can be used to make consistent substitutions over
a set of source files, thus avoiding the problem entirely. If
properly selected the entire process is also reversible. In fact
one of the testing examples converts its own source into something
with only 2 character identifiers, and back again. See:

<http://cbfalconer.home.att.net/download/id2id-20.zip>>


That looks like one starting point, but you really need to know
what ID's are in use, which is not always easier. Why is this
better than the "#define" approach I have been using so far?


Because you don't have to distort anything. To get a list of ids
in your own package just run a cross-referencer. You are only
interested in ids that exceed the maximum length your linker can
handle, easily extracted from the xref with standard tools.

--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>

May 10 '06 #6

"CBFalconer" <cb********@yahoo.com> wrote in message
news:44***************@yahoo.com...
David Wade wrote:
"CBFalconer" <cb********@yahoo.com> wrote in message
David Wade wrote:

Does any one know of any "name mangling" software that allows
standard C with long names to be linked? Any suggestions for a
better place to look? I have tried putting various searchs into
google to no avail.

My id2id package can be used to make consistent substitutions over
a set of source files, thus avoiding the problem entirely. If
properly selected the entire process is also reversible. In fact
one of the testing examples converts its own source into something
with only 2 character identifiers, and back again. See:

<http://cbfalconer.home.att.net/download/id2id-20.zip>>
That looks like one starting point, but you really need to know
what ID's are in use, which is not always easier. Why is this
better than the "#define" approach I have been using so far?


Because you don't have to distort anything. To get a list of ids
in your own package just run a cross-referencer. You are only
interested in ids that exceed the maximum length your linker can
handle, easily extracted from the xref with standard tools.


Unfortunatly my assembler gets upset as well :-(
--
"If you want to post a followup via groups.google.com, don't use
the broken "Reply" link at the bottom of the article. Click on
"show options" at the top of the article, then click on the
"Reply" at the bottom of the article headers." - Keith Thompson
More details at: <http://cfaj.freeshell.org/google/>
Also see <http://www.safalra.com/special/googlegroupsreply/>

May 10 '06 #7

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

Similar topics

4
by: sunny | last post by:
Hi, I was trying to call a function in an an asm file from a C file(driver). In c file the funcrtion is defined as: extern int foo(int,int); In the asm file the function is defined as _foo. ...
1
by: Tim Slattery | last post by:
Does the C++ language standard mandate a particular name-mangling method? I'm trying to use the Entrust toolkit to create a C++ program that encrypts and decrypts files. Entrust supplies header...
6
by: yyy | last post by:
my question is rather theoretical than practical in the pure programming aspect... is "name mangling" the same as "name decorating" ? browsing the web, you might find multiple people saying...
1
by: noleander | last post by:
I need to use a library supplied by someone else: libjpeg.lib. This is a plain C library. I do not have the source code. I do have the header *.h files. When I run dumpbin on the libjpeg.lib,...
5
by: Subhransu Sahoo | last post by:
Hi All, Does the C++ standard tell function overloading can't be done with the return types of two functions ? If so, is it true that the name mangling scheme does not take the return type into...
8
by: sam_cit | last post by:
Hi Everyone, I read somwhere that c++ compiler does name mangling of functions which is why c source code can't invoke functions from object files that were generated using c++ compiler. Can...
15
by: dspfun | last post by:
Hi, Is it possible to print the function name of the calling function? For example, f1() and f2() both calls f3(), in f3() I would like to print the name of the function calling f3() which...
4
by: jason.cipriani | last post by:
Does anybody know if C++0x is going to change C++ name mangling at all? Such as, standardizing name mangling instead of leaving it up to the compiler? Jason
14
by: Megalo | last post by:
why not make "name mangling" of C++ standard so should be possible to call the classes and the functions of C++ from other C++ compiler thanks
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

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.