[PATCH] linker BLOCK/ALIGN/LMA memory region functions

Timothy Wall twall@alum.mit.edu
Wed Feb 9 07:57:00 GMT 2000


This patch adds the following functions to the linker:

1) Blocking: a weak sort of alignment.  Insist that a section fit within
the blocking size, or be aligned to the blocking size if it doesn't.
2) Alignment into a memory region.  Allow specification of an alignment
boundary for a section output into a memory region.
NOTE: reviewing the docs, it looks like NEXT(EXP) may already do this.
Please comment if you're familiar with this area.  If NEXT(EXP) does the
same job, this section would be removed.
3) Load-time memory regions.  Allow linking into a load-time memory
region instead of a specific load-time address.

* ld/ld.h: Add BLOCK_N macro for setting a blocking address.
* ld/ld.texinfo: Add documentation for new linker script commands.
* ld/ldexp.c (exp_fold_tree): Handle BLOCK expression type.
* ld/ldgram.y: Add handling of new tokens.
* ld/ldlang.c (lang_output_section_statement_lookup): Make use of LMA
region, if available.
  (os_region_check): New function to verify an output section fits
within a region.
  (lang_size_sectiosn): Apply section blocking instead of ALIGN_N no-op.
Use
   os_region-check on vma and lma regions.
  (lang_leave_output_section_statement): Handle align and blocking
parameters.
  (lang_leave_overlay_section): Ditto.
  (lang_leav_overlay): Ditto.
* ld/ldlang.h: Add lma_region and new prototypes.
* ld/mri.c (mri_draw_tree): Add extra align/block parameters.
* ld/emultempl/armelf.em, elf32.em, pe.em: Add default values for new
align/block parameters to
  lang_leave_output_section_statement() calls.








More information about the Binutils mailing list