Usenet comp.sys.dec (1990-2013)
 help / color / mirror / Atom feed
* mips symbol table stripping
@ 1989-09-21  1:07 Daniel McCoy
  1989-09-22 16:43 ` bug in ds3100 cc? John Sahr
  0 siblings, 1 reply; 4+ messages in thread
From: Daniel McCoy @ 1989-09-21  1:07 UTC (permalink / raw)


Is there a tool around for manipulating the mips object file
symbol table?   (SGI 4D, DEC 3100, etc.)

I have created an object file which contains a large package 
linked together with the relocation preserved. (ld -r)
The idea is that customers will be able to link this package into
their application as a major subsystem. (They also have the
option of running it as a separate program.)
  
That works fine, but all of the global symbols that link the guts of
the package together are still present in the symbol table.

I want to preserve the set of symbols that define the interface 
to the package as well as undefined references to system libraries.   
I would like to either remove or remap any other symbols,
so as to avoid accidental symbol collisions with applications.

Changing the source of the package is not an option.

There is a set of functions for reading mips coff files, 
(sgi: ldfcn(4), dec ldfcn(5)),
but they make no provisions for writing things back out.

strip(1) is pretty much all or nothing.

I'm in the process of rolling my own, but I would appreciate anything
that might be of help.

Thanks,

Dan McCoy    pixar!mccoy    (415) 258-8195   Pixar, San Rafael, Ca


^ permalink raw reply	[flat|nested] 4+ messages in thread

* bug in  ds3100 cc?
  1989-09-21  1:07 mips symbol table stripping Daniel McCoy
@ 1989-09-22 16:43 ` John Sahr
  1989-09-22 20:31   ` Chris Siebenmann
  1989-09-23  8:12   ` Roger B.A. Klorese
  0 siblings, 2 replies; 4+ messages in thread
From: John Sahr @ 1989-09-22 16:43 UTC (permalink / raw)


I have run across a bug in the MIPS cc C compiler (or in my understanding).
Consider the following.

#include <stdio.h>

int test(void *b)
{
  printf("%d\n", *((int *) b));
  return 0;
}

int main()
{
  int four = 4;
  
  return test((void *) &four);
}

On a microvax (2000, ultrix)  vcc and gcc (1.34) compile this and the result
runs fine. vax cc objects, though (not surprising to me).
On a DS3100, cc objects to the printf("%d\n", *((int *) b)), saying that
b is undefined.  Putting a prototype before test() does not help, and making

typedef void *anonymous;

to replace the void * doesn't help either.  Any comments?  The MIPS cc 
seems to handle the new style declarations pretty well, except for this.

int test(b)
void *b;
{ .... }

Neither uvax lint nor MIPS lint approve of this declaration "b may be used
before set..." among other things.  Does this all mean that the 
"MIPS cc does not know about `void *' as `anonymous ptr'?"

-john

-- 
John Sahr,     Dept. of Electrical Eng., Cornell University, Ithaca, NY 14853
johns@{alfven,calvin}.ee.cornell.edu,  {rochester,cmcl2}!cornell!calvin!johns
--When the dust settles, each B2 bomber will fund NSF for more than a year--


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug in  ds3100 cc?
  1989-09-22 16:43 ` bug in ds3100 cc? John Sahr
@ 1989-09-22 20:31   ` Chris Siebenmann
  1989-09-23  8:12   ` Roger B.A. Klorese
  1 sibling, 0 replies; 4+ messages in thread
From: Chris Siebenmann @ 1989-09-22 20:31 UTC (permalink / raw)



 "Losing" variables declared void * appears to be a problem generic to
pcc-derived compilers; if you try it with Ultrix /bin/cc, you will get
the same error message. Right now, the only solution I know of is to
compile with "-Dvoid=int"; you could also try bringing gcc up on the
DS3100.

-- 
	"I shall clasp my hands together and bow to the corners of the world."
			Number Ten Ox, "Bridge of Birds"
Chris Siebenmann		...!utgpu!{ncrcan,ontmoh!moore}!ziebmef!cks
cks@white.toronto.edu	     or ...!utgpu!{,csri!}cks


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: bug in  ds3100 cc?
  1989-09-22 16:43 ` bug in ds3100 cc? John Sahr
  1989-09-22 20:31   ` Chris Siebenmann
@ 1989-09-23  8:12   ` Roger B.A. Klorese
  1 sibling, 0 replies; 4+ messages in thread
From: Roger B.A. Klorese @ 1989-09-23  8:12 UTC (permalink / raw)


In article <1333@calvin.EE.CORNELL.EDU> johns@calvin.spp.cornell.edu.UUCP (John Sahr) writes:
>Does this all mean that the 
>"MIPS cc does not know about `void *' as `anonymous ptr'?"

That's precisely what it means.  Our release 2.10, coming early next year on
our systems and I-don't-know-when from our licensees, will handle this.
-- 
ROGER B.A. KLORESE      MIPS Computer Systems, Inc.      phone: +1 408 720-2939
928 E. Arques Ave.  Sunnyvale, CA  94086                        rogerk@mips.COM
{ames,decwrl,pyramid}!mips!rogerk
"I want to live where it's always Saturday."  -- Guadalcanal Diary


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1989-09-23  8:12 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
1989-09-21  1:07 mips symbol table stripping Daniel McCoy
1989-09-22 16:43 ` bug in ds3100 cc? John Sahr
1989-09-22 20:31   ` Chris Siebenmann
1989-09-23  8:12   ` Roger B.A. Klorese

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox