bartop

palmoswerks ARCHIVE
Palm OS programming tips from a (former) CodeWarrior insider

header

Navigation

Search
Home
About
Stories
Stuff I Like
Articles
PilRC
CodeWarrior
palmos.techwood.org
DevTools List
Palm OS Dev FAQ

Using .seg Files to Segment Your Application

Author:   Ben Combee  
Posted: 2/9/04; 12:48:50 PM
Topic: Using .seg Files to Segment Your Application
Msg #: 159 (top msg in thread)
Prev/Next: 158/160
Reads: 1468

Several people at PalmSource 2002 asked me for a better way to specify segmentation for their projects. In looking at the 68K linker source, it looks like the linker supports this already using .seg files added to your project.

The format, as described in the comments is

{ "<segment_name>" [= <hex>] "<name1>" ... "<namen>" }
"<segname1>" = "<segname2">

The brace delimited areas specify segment names and list all the functions/symbols that will be allocated to that segment. The optional hex value (with no leading 0x) is used to set segment attributes, so it won't be too useful on Palm OS. The other notation is used to rename a segment -- this looks useful for pulling in code from a static library that has been build with "#pragma segment" calls.

I'm not sure if this code works, but it looks like its been in the tools for a while, so I assume this was a key feature back when the 68K toolset was a primary tool of MacOS development. I've dug up some old manuals, and this file format was mentioned in CW11 and CWPro1, but not in CWPro3. However, all the support is still there.

This should work for both the Mac OS 68K Linker and Palm OS 68K Linker, as they share code that deals with segmentation.


Send feedback to combee@techwood.org
Copyright © 2004 Benjamin L. Combee
Palm OS is a registered trademark of PalmSource, Inc.
Metrowerks and CodeWarrior are registered trademarks of Metrowerks Inc.

The views expressed on this website/weblog are those of mine alone and do not necessarily reflect the views of PalmSource or Metrowerks.

This is a Manila Site

qwertYAK / frobnovich