• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: What's an external relocation entry?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What's an external relocation entry?


  • Subject: Re: What's an external relocation entry?
  • From: Malte Tancred <email@hidden>
  • Date: Tue, 27 Nov 2001 15:17:17 +0100

Hmmm, well, what IS an external relocation entry? I didn't mention
it in the message anyway. Somehow the Subject: didn't change
with the message body... sorry for that.

One of the errors I got when tweaking the build scripts made ld
spit out a message out saying that a .o file contained external
reloction entries in a non-writable <place...area...something> in
the TEXT- segment... or something like that.

/m

I wrote:
I've tried to find information here on the list on compiling
static libraries on Mac OS X 10.1. I read something just the
other day stating that the tools depend on specific names
for different types of libraries, ie .a for static libraries and
.dyld for dynamic libraries.

Now, I'm trying to compile an open source product where
all c files are (by default) compiled with:

cc -c file.c

Many of these .o-files are grouped together in static libraries
with the commands:

ar cr library.a o-files...
ranlib library.a

Programs are then loaded by issuing the following command:

cc -s -o program program.o <other .o-files and .a-files>

This is the default setup that works just fine on for example
OpenBSD and slackware linux.

When running with this configuration (except for the -s option
which isn't supported on Mac OS X) I get the following warning
late in the build process, building one of several programs:

/usr/bin/ld: Undefined symbols:
_strerr_sys
/usr/bin/ld: warning unused multiple definitions of symbol _puts
ofmipd.o definition of _puts in section (__TEXT,__text)
/usr/lib/libSystem.dylib(puts.o) unused definition of _puts

strerr_sys is already compiled into one of the libraries and that
library's been used earlier on in the build process for another program.

Two things come to mind:
1. libSystem.dylib is a dynamic library. I'm compiling static libraries.
2. Mixing .o and .a files as source file for the linker might not work
as expected. Is the order a problem on Mac OS X.

I've tried adding -static to both the compile and link phase to make
sure everything is compiled statically. This results in the following
line:

/usr/bin/ld: can't locate file for: -lcrt0.o

Isn't it possible to compile statically linked programs on Mac OS X?

Any ideas welcome!

Cheerio,
Malte

--
Malte Tancred
Computer programmer, Oops AB, Sweden
mailto:email@hidden
http://www.oops.se/
_______________________________________________
cocoa-dev mailing list
email@hidden
http://www.lists.apple.com/mailman/listinfo/cocoa-dev


References: 
 >What's an external relocation entry? (From: Malte Tancred <email@hidden>)

  • Prev by Date: Newbie Mac Programmer-wannabe question
  • Next by Date: Re: horizontal tabs in TabView
  • Previous by thread: What's an external relocation entry?
  • Next by thread: Re: width of NSString in pixels
  • Index(es):
    • Date
    • Thread