 diff -Nur sdk/trts/trts.cpp sdk/trts/trts.cpp
 --- sdk/trts/trts.cpp
 +++ sdk/trts/trts.cpp
-@@ -39,6 +39,7 @@
+@@ -39,6 +39,8 @@
  #include "global_data.h"
  #include "trts_internal.h"
  #include "internal/rts.h"
 +#include "rts_config.h"
++#include "trts_util.h"
  
  #ifdef SE_SIM
  #include "t_instructions.h"    /* for `g_global_data_sim' */
+@@ -318,3 +320,7 @@
+     return 0;
+ }
+ 
++void sgx_memory_layout(struct MemoryLayout *memory_layout)
++{
++    get_memory_layout(memory_layout);
++}
 diff -Nur sdk/trts/trts_ecall.cpp sdk/trts/trts_ecall.cpp
 --- sdk/trts/trts_ecall.cpp
 +++ sdk/trts/trts_ecall.cpp

 #include "sgx_error.h"
 #include "stddef.h"
 #include "sgx_defs.h"
diff -Nur common/inc/sgx_urts.h common/inc/sgx_urts.h
--- common/inc/sgx_urts.h
+++ common/inc/sgx_urts.h

 typedef uint8_t		Elf_Byte;
 
 typedef uint32_t	Elf32_Addr;	/* Unsigned program address */
diff -Nur common/inc/internal/global_data.h common/inc/internal/global_data.h
--- common/inc/internal/global_data.h
+++ common/inc/internal/global_data.h
@@ -50,6 +50,10 @@
     sys_word_t     enclave_size;
     sys_word_t     heap_offset;
     sys_word_t     heap_size;
+    sys_word_t     data_offset;
+    sys_word_t     data_size;
+    sys_word_t     bss_offset;
+    sys_word_t     bss_size;
     sys_word_t     thread_policy;
     thread_data_t  td_template;
     uint8_t        tcs_template[TCS_TEMPLATE_SIZE];
diff -Nur common/inc/internal/metadata.h common/inc/internal/metadata.h
--- common/inc/internal/metadata.h
+++ common/inc/internal/metadata.h
