Merge pull request #8 from riscv/sqrt-171
[riscv-tests.git] / benchmarks / common / test.ld
index 952bf539688c5a3da905e0cec0d6cdc8a4f0e9d7..db4ec452ea4c484c70048a5176a4b351e16b7c6c 100644 (file)
 
 OUTPUT_ARCH( "riscv" )
 
-/* The ENTRY command specifies the entry point (ie. first instruction
-   to execute). The symbol _start should be defined in each test. */
-
-ENTRY( _start )
-
 /*----------------------------------------------------------------------*/
 /* Sections                                                             */
 /*----------------------------------------------------------------------*/
@@ -26,17 +21,41 @@ SECTIONS
 {
 
   /* text: test code section */
-  . = 0x00002000;
+  . = 0x100;
   .text : 
   {
     crt.o(.text)
     *(.text)
   }
 
-  /* data: Initialized data segment */
-  .data : 
+  /* data segment */
+  .data : { *(.data) }
+
+  .sdata : {
+    _gp = . + 0x800;
+    *(.srodata.cst16) *(.srodata.cst8) *(.srodata.cst4) *(.srodata.cst2) *(.srodata*)
+    *(.sdata .sdata.* .gnu.linkonce.s.*)
+  }
+
+  /* bss segment */
+  .sbss : {
+    *(.sbss .sbss.* .gnu.linkonce.sb.*)
+    *(.scommon)
+  }
+  .bss : { *(.bss) }
+
+  /* thread-local data segment */
+  .tdata :
+  {
+    _tls_data = .;
+    crt.o(.tdata.begin)
+    *(.tdata)
+    crt.o(.tdata.end)
+  }
+  .tbss :
   {
-    *(.data)
+    *(.tbss)
+    crt.o(.tbss.end)
   }
 
   /* End of uninitalized data segement */