/*
 * Copyright (c) 2013-2018 TRUSTONIC LIMITED
 * All rights reserved
 *
 * The present software is the confidential and proprietary information of
 * TRUSTONIC LIMITED. You shall not disclose the present software and shall
 * use it only in accordance with the terms of the license agreement you
 * entered into with TRUSTONIC LIMITED. This software may be subject to
 * export or import laws in certain countries.
 */

OUTPUT_FORMAT("elf32-littlearm")
OUTPUT_ARCH(arm)

ENTRY(_tlEntry)

PHDRS
{
   phdr1  PT_LOAD FLAGS(0x80000007);
}


SECTIONS
{
   . = 0x1000;

   .text :
   {
      KEEP(*(stext))
      KEEP(*(relocInfo))
      *(.text)
      *(.text.*)
      *(.init)
      *(.conststring)
      *(text)
      *(.rodata .rodata.* .gnu.linkonce.r.*) *(.constdata)
      *(etext)
      __init_array_start = .;
      KEEP (*(SORT_BY_INIT_PRIORITY(.init_array.*)
            SORT_BY_INIT_PRIORITY(.ctors.*)))
      KEEP (*(.init_array .ctors))
      __init_array_end = .;
      *(.got*)
      *(.data.rel.ro)
   } :phdr1


   .rel.dyn :
   {
       __reldyn_start = .;
       *(.rel.dyn)
   }
   __reldyn_end = .;

   /*In the virtual address space we leave one page unused between code and data*/
   . = . + 0x1000;
   .data ALIGN(0x1000):
   {
      KEEP(*(sdata))
      *(.data .data.* .gnu.linkonce.d.*)
      *(.data.rel*)
      *(edata)
      . = ALIGN(16);
   }

   .bss :
   {
      _sbss = .;
      *(COMMON)
      *(stack)
      *(heap)
      *(.bss.*)
      *(.bss)
      *(.tci)
   }

   .interp :
   {
      *(.interp*)
   }


   .dynamic :
   {
      *(.dynamic*)
   }

   .dynsym :
   {
      *(.dynsym)
   }

   .dynstr :
   {
      *(.dynstr)
   }

   .hash :
   {
      *(.hash)
   }

   .gnu.hash :
   {
      *(.gnu.hash)
   }

   .ARM.exidx :
   {
      *(.ARM.exidx*)
   }

   /DISCARD/ :
   {
      *(.plt) /* used for symbolic dynamic linking, not supported */
      *(.ARM.attributes)
      *(.arm_vfe_header)
      *(.note.gnu.build-id)
      *(.note.gnu.gold-version)
   }
}
