Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
General
GeneralPortable MacsHardwareNetworking
Applications
Mac ApplicationsEudoraFirefox / MozillaInternet ExplorerOutlook ExpressMS OfficeEntourageExcelPowerPointWordVirtual PCMedia PlayerOther MS Products
Programming
Mac ProgrammingCodeWarriorPerl
Country Specific
Australian Mac GroupUK Mac Group

Mac Forum / Programming / CodeWarrior / June 2004



Tip: Looking for answers? Try searching our database.

CW 8.3 Dynamic library link "overlap"?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Alen Shapiro - 24 Jun 2004 20:23 GMT
CW 8.3 under MacOS 10.3.4 with Xcode 1.2.

When I link my CW MacOS X PowerPC MACH-O project I get the following
warning in 4 of my similarly configured projects:

dynamic library '/usr/lib/libSystem.B.dylib' section '__LINKEDIT'
($90123000-$9017189C)
overlaps with dynamic library '
›ü»' section '__TEXT' ($90130000-$901E9000)
(need to run redo_prebinding)

Code seems to run ok (except that stdin appears to be permanently
closed in one (but not all) of my projects!!). Any ideas?

TIA
--alen
MW Ron - 25 Jun 2004 01:16 GMT
>CW 8.3 under MacOS 10.3.4 with Xcode 1.2.
>
[quoted text clipped - 6 lines]
>›ü»' section '__TEXT' ($90130000-$901E9000)
>(need to run redo_prebinding)

Apple reserves some of the addresses  you can't use them for your
libraries  So turn off prebinding for that.

>Code seems to run ok (except that stdin appears to be permanently
>closed in one (but not all) of my projects!!). Any ideas?

Don't have a clue why it would affect that but you might need to prebind
a lib to a different address.

Ron

Signature

 Metrowerks, one of the world¹s top 100 companies and influencers
    in the software development industry. - SD Times  May 2004
              http://www.sdtimes.com/2004sdt100.htm
     
                 Metrowerks, maker of CodeWarrior
Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com

Alen Shapiro - 25 Jun 2004 04:50 GMT
I did not realize I had any control over prebinding and had not
prebound any components myself. How do I turn off prebinding and how
can I tell what is the name of the second library that the conflict is
with (looks like a garbage name to me).

TIA (again)
--alen

> >CW 8.3 under MacOS 10.3.4 with Xcode 1.2.
> >
[quoted text clipped - 17 lines]
>
> Ron
Miro Jurisic - 25 Jun 2004 05:30 GMT
> I did not realize I had any control over prebinding and had not
> prebound any components myself. How do I turn off prebinding and how
> can I tell what is the name of the second library that the conflict is
> with (looks like a garbage name to me).

Turning off prebinding is a bad idea. It will negatively affect the performance
of your application. It's an easy answer for Ron to give to you, but it's the
wrong one.

You are not the first one to run into this -- searching groups.google.com for
"codewarrior overlaps with dynamic library" reveals that this has been noted
repeatedly on the newsgroup. According to a posting from Josef Wankerl, this is
fixed in an update to the CW 9 tools, although he doesn't say which update.

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

Alen Shapiro - 25 Jun 2004 07:31 GMT
Thanks meeroh,

I'll try to find the time to upgrade to CW9 (cringe).

--alen

> > I did not realize I had any control over prebinding and had not
> > prebound any components myself. How do I turn off prebinding and how
[quoted text clipped - 13 lines]
>
> meeroh
MW Ron - 25 Jun 2004 16:08 GMT
>Turning off prebinding is a bad idea. It will negatively affect the
>performance
>of your application. It's an easy answer for Ron to give to you, but it's the
>wrong one.

GUILTY as charged, it was not one of my better responses

Here is a much better answer....

Prebinding (which is on by default), requires that all dynamic  
libraries used by the application don't have addresses which overlap.  
The dynamic loader can deal with the problem (which is why these are  
only warnings), but the code will run slow as it will require a dynamic  
fixup to it's relocations.

You should build your dynamic library with a different starting address
using the option -seg1addr long, the Metrowerks makes the default for a
.dylib to be 0x01 000000 (default for a application/executable is
0x1000). Most of the system libraries are at addresses > 0x80000000

http://developer.apple.com/tools/projectbuilder/Prebinding.html

The default prebound address works fine for Applications so leave the
"Prebound Address" field blank, it will default to 0x1000 for
applications and 0x0100000 for dylibs (the change in default prebound
address for dylibs was changed in 8.1 to be 0x0100000 it used to be
0x1000).

The only reason you would need to change the default is if you are
building more than one dylib, (or using a dylib someone else build
which conflicts with the default).

There are reasons why a different prebound address would be used for
the application, but they are fairly rare. Classic for example uses a
different prebound address since it maps in a 9.1 style low memory
global variables page, and moves things around so that the memory map
mostly looks like it does when actually running in 9.X

>  least 33 of our internal plugins and possibly more if 3rd party plugins are
>  available in the user's config.  How do I know if overlapping will occur?

Also note that plug-ins are never pre-bound. It would be too hard to
know ahead of time what addresses some new plug-in should load at, or
how the program that loads them might change over time. Perhaps I
have implemented it wrong but pre-binding is disabled with Bundles
(aka plug-ins).

Signature

 Metrowerks, one of the world¹s top 100 companies and influencers
    in the software development industry. - SD Times  May 2004
              http://www.sdtimes.com/2004sdt100.htm
     
                 Metrowerks, maker of CodeWarrior
Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com

MW Ron - 25 Jun 2004 16:07 GMT
>I did not realize I had any control over prebinding and had not
>prebound any components myself. How do I turn off prebinding and how
>can I tell what is the name of the second library that the conflict is
>with (looks like a garbage name to me).

If you look in your Target Settings for the PPC Mac OS X  Target  
prefernece panel  you will see an option to disable prebinding or to set
the address for something else.

Prebinding (which is on by default), requires that all dynamic  
libraries used by the application don't have addresses which overlap.  
The dynamic loader can deal with the problem (which is why these are  
only warnings), but the code will run slow as it will require a dynamic  
fixup to it's relocations.

You should build your dynamic library with a different starting address
using the option -seg1addr long, the Metrowerks makes the default for a
.dylib to be 0x01 000000 (default for a application/executable is
0x1000). Most of the system libraries are at addresses > 0x80000000

http://developer.apple.com/tools/projectbuilder/Prebinding.html

Ron

Signature

 Metrowerks, one of the world¹s top 100 companies and influencers
    in the software development industry. - SD Times  May 2004
              http://www.sdtimes.com/2004sdt100.htm
     
                 Metrowerks, maker of CodeWarrior
Ron Liechty - MWRon@metrowerks.com - http://www.metrowerks.com

Miro Jurisic - 25 Jun 2004 20:45 GMT
> You should build your dynamic library with a different starting address
> using the option -seg1addr long, the Metrowerks makes the default for a
> .dylib to be 0x01 000000 (default for a application/executable is
> 0x1000). Most of the system libraries are at addresses > 0x80000000

The problem, Ron, is that this bogus linker error comes up in CW8 even when you
are not using any 3rd party libraries.

meeroh

Signature

If this message helped you, consider buying an item
from my wish list: <http://web.meeroh.org/wishlist>

 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.