target-specific way to make ld -N the default

Doug Evans dje@transmeta.com
Wed Oct 23 08:48:00 GMT 2002


Nick Clifton writes:
 > Hi Doug,
 > 
 > > In the meantime there is LDEMUL_BEFORE_PARSE.
 > > I see the mmix port is already making an attempt at this:
 > > 
 > > static void
 > > elfmmix_before_parse ()
 > > {
 > >   gld${EMULATION_NAME}_before_parse ();
 > > 
 > >   /* Make sure we don't create a demand-paged executable.  Unfortunately
 > >      this isn't changeable with a command-line option.  It makes no
 > >      difference to mmo, but the sections in elf64mmix will be aligned to a
 > >      page in the linked file, which is non-intuitive.  If there's ever a
 > >      full system with shared libraries and demand paging, you will want to
 > >      exclude this file.  */
 > >   config.magic_demand_paged = false;
 > > }
 > 
 > I rather like this solution.  It lets individual targets make up their
 > own minds about the default without requiring the rather clumsy
 > definition of EMBEDDED or (shudder, grin) REALLY_EMBEDDED.  The only
 > problem is the lack of a way to override the default "-N" behaviour
 > from the command line, and solving that is easy:

I dunno if I'd call it cleaner.
"no room for program headers" (and program headers in general) seem
absolutely bogus for embedded targets.  We can't break existing code
so we can't just make -N the default if EMBEDDED, but all else being equal,
that feels much cleaner than having every embedded target
start providing foo_before_parse routines (which methinks
is really just a workaround to an oversight made way back when).



More information about the Binutils mailing list