except clauses
section selectors are the mechanism that is used to specify which sections an ILINK directive should be applied to. By placing section selectors inside an except clause, they are used for the reverse purpose—to specify which sections an ILINK directive should not be applied to.
If except clauses are used in a directive with nestling blocks, note that the outermost except clause will affect all nestled sub-blocks, and that except clauses are additive—if there is a block B defined within a block A, and both have except clauses, block B is affected by both its own except clause and block A's except clause.
An example:
define section A {
udata32 5;
};
keep { section A };
place at address 0x500 { section A, block B } except { section A };
define block B { section A, block C };
define block C { section A };
place at address 0x600 { section A };The first place at directive has an except clause that removes section A from the pattern, and the nestled patterns in block B and block C remove also block B. As a result there is only a single, unambiguous match for where to place section A—the place at directive on the last line.
Note
If a section selection pattern is ambiguous, the linker emits an error, but there are no warnings for "dead patterns" such as the ones in the example.