Path: utzoo!attcan!uunet!spool.mu.edu!uwm.edu!bionet!agate!usenet.ins.cwru.edu!odin!chet From: chet@odin.INS.CWRU.Edu (Chet Ramey) Newsgroups: comp.sys.next Subject: Re: Library function redefinition Message-ID: <1991Mar1.143756.12400@usenet.ins.cwru.edu> Date: 1 Mar 91 14:37:56 GMT References: <1991Feb28.190319.22658@usenet.ins.cwru.edu> Sender: news@usenet.ins.cwru.edu Reply-To: chet@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 38 Nntp-Posting-Host: odin.ins.cwru.edu I wrote: >I just got a NeXT box for a couple of days, and the first thing I built was >bash (of course ;-). When trying to use private versions of functions in >libsys_s.a, this error results: > >>variables.o definition of _getenv in section (__TEXT,__text) >>/lib/libsys_s.a(getenv.o) definition of absolute _getenv (value 0x50025d0) > >Is there a switch to cc or ld that will allow you to use a private version >of a library function? Before I get any more mail telling me to comment out the private getenv definition, let me explain what I am after. Bash (the Gnu Bourne-Again SHell) provides a private definition of getenv that searches the list of exported variables (those variables passed to children of the shell as the environment). This is so the libraries that Bash uses, most notably readline, will get the `intuitive' definition of environment variables when they call getenv(). TERM, for instance. The `traditional' Unix linker satisfies only unresolved external references from libraries. This allows you to provide an application with a custom malloc, for instance, and have all of the libraries that use malloc cooperate. It seems that the NeXT/Mach ld simply maps the library into my process's address space, and damn any symbols that I already defined. What I would like is a switch to cc or ld that restores the traditional behavior, even in the presence of shared libraries. If it can't be done, that's OK, too. Chet -- Chet Ramey ``Now, somehow we've brought our sins Network Services Group back physically -- and they're Case Western Reserve University pissed.'' chet@ins.CWRU.Edu My opinions are just those, and mine alone.