/* Note: the value 0x400000 used in this file can be changed
to specify
 * more or less space, but it must always be a multiple of
0x1000.
 */
SECTIONS
{
     /* Leave enough room for headers before starting .text */
     .text 0x200 BLOCK(0x200) : { *(.init) *(.text) }

     /* .data and .bss are just like the default */
     GROUP BIND (NEXT(0x1000) + ((SIZEOF(.text) + ADDR(.text)) % 0x1000)) :
     {
          .data     : { }
          .bss : { }
     }

     /* All this just to say 0x400000 (4 MB) beyond the end .bss,
      * then align to the next page.
      */
     GROUP BIND
         ( 0x400000  /* <-- Adjust this to change .bss to .shdata gap */

           /* end of .bss */
           + NEXT(0x1000) + ( ( SIZEOF(.text) + ADDR(.text) ) % 0x1000 )
           + SIZEOF(.data) + SIZEOF(.bss)

           /* align to next page */
           + 0x1000
           -  ( ( ( ( SIZEOF(.text) + ADDR(.text) ) % 0x1000 )
                    + SIZEOF(.data) + SIZEOF(.bss) ) % 0x1000 )
         ) BLOCK (0x1000) :
     {
          .shdata   : { }
          .shbss  : { }
     }

     /* Like the default */
     .comment BLOCK(0x1000) : { *(.comment) }
}
