[PATCH] misc BFD flags

Ian Lance Taylor ian@zembu.com
Thu Apr 6 15:54:00 GMT 2000


   Date: Wed, 05 Apr 2000 22:05:28 -0400
   From: Timothy Wall <twall@cygnus.com>

   This patch adds the following functionality to bfd and objdump,
   primarily for targets using TI COFF:

   C_STATLAB:  Define handling for this storage class, which indicates a
   load-time (lma) versus run-time (vma) address.
   SEC_CLINK: Sections marked with this flag are linked only if
   referenced.  Same function as --gc-sections in the linker, but allows
   specific sections to be marked.
   SEC_BLOCK: Marks a section for blocking, a weaker form of alignment.
   Blocked sections must not cross a page boundary, where the page value is
   typically either fixed for a given target or the alignment value of the
   section.

   + 	* coffcode.h (coff_slurp_symbol_table): Handle C_STATLAB storage
   + 	class.  Handle SEC_CLINK and SEC_BLOCK flags.
   + 	* section.c: Add SEC_CLINK and SEC_BLOCK flags.
   + 	* bfd-in2.h: Add SEC_CLINK and SEC_BLOCK flags.

This is basically OK.

   !             {
   !               syment->n_value += (syment->n_sclass == C_STATLAB) ?
   !                 coff_symbol_ptr->symbol.section->output_section->lma :
   !                 coff_symbol_ptr->symbol.section->output_section->vma;
   !             }

Please use correct GNU formatting.

   + .	{* This section should be blocked (weak alignment).  Guarantees a
   + .          section will not cross a page boundary if smaller than a page, or
   + .          be aligned on a page boundary if >= a page.  *}
   + .#define SEC_BLOCK 0x8000000
   + .
   + .	{* Conditionally link this section; link only if there are no
   + .          references found to any symbol in the section.  *}
   + .#define SEC_CLINK 0x10000000

I think we need to improve these comments.

How about this for SEC_BLOCK:

    When a section with this flag is being linked, then if the size of
    the input section is less than a page, it should not cross a page
    boundary.  If the size of the input section is one page or more,
    it should be aligned on a page boundary.

How should SEC_BLOCK be treated by ld -r?

Your SEC_CLINK description says that the section is included if there
are no references.  That seems odd.

Ian


More information about the Binutils mailing list