Path: utzoo!utgpu!water!watmath!clyde!att!osu-cis!killer!ames!ncar!oddjob!uwvax!umn-d-ub!umn-cs!bungia!n0atp!barry From: barry@n0atp.UUCP (Barry S. Berg) Newsgroups: comp.unix.xenix Subject: Re: /bin/ld problem (too many segments) Summary: Its all in the way Lattice did it :-< Keywords: -SEG compiler flags Message-ID: <12@n0atp.UUCP> Date: 9 Jun 88 04:01:42 GMT References: <304@marob.MASA.COM> Reply-To: barry@n0atp.UUCP (Barry S. Berg) Followup-To: comp.unix.xenix Organization: N0ATP, Amateur Radio Packet Gateway, St. Paul, MN Lines: 42 In article <304@marob.MASA.COM> daveh@marob.UUCP (Dave Hammond) writes: > >In compiling a large program I am getting a /bin/ld error "too many segments". >The problem seemed to go away when I combined several library archives into >a single large archive, only to return later on. The problem can obviously >be fixed with the CC flag -SEG nn, however I feel that this may be a kludge ^^^^^^^ >covering up a deeper-seated problem. So: SEG is a compiler kludge created by the fact that 8086/8 80286 etc have limited (64K) segments for data/stack/code portions. Rather than implement a simulated 32 bit work space Lattice determined to create lots of little (64K) segments when they developed their C compiler. Microsoft used the Lattice compiler, until I believe it was their 3.0 release. Thus they have carried this kludge with them. > 2. Is there some way I can tell how many segments are being used by > /bin/ld in composing my program? Does /bin/ld leave segements > partially filled (or start new segments) based upon certain conditions ? Use the option to create a map file. That map will show the segments. > 3. The CC man page states that -SEG will take arguments from 1 to 1024. > What is the default which was exceed here ("too many segments") ? 128 or 256 Segments (Brain fade is getting very acute here :-) ) > 4. Is use of the -SEG flag common in large programs which are composed > of many small object files? If not, should modularity be sacrificed in > this case? That is a programmer's decision. Each case should be considered on its own merits. However, think of the person who has to maintain the code. After all it might be me, or worse yet -- you :-) ---- Barry S. Berg DOMAIN: barry@n0atp.N0ATP.MN.ORG N0ATP Packet Radio Gateway UUCP: {...}amdahl!bungia!n0atp!barry "Speech is civilization itself--it is silence which isolates." --Thomas Mann "Moderation in all things, most especially moderation." --Author as yet unknown. -- Barry S. Berg DOMAIN: barry@n0atp.N0ATP.MN.ORG N0ATP Packet Radio Gateway UUCP: {...}amdahl!bungia!n0atp!barry "Speech is civilization itself--it is silence which isolates." --Thomas Mann "Moderation in all things, most especially moderation." --Author as yet unknown.