diff --git a/loader/src/common/retain_vars.cpp b/loader/src/common/retain_vars.cpp
index 3541a88..87df32e 100644
--- a/loader/src/common/retain_vars.cpp
+++ b/loader/src/common/retain_vars.cpp
@@ -12,3 +12,7 @@ int ntfs_mount_count __attribute__((section(".data"))) = 0;
struct buffer_store drc_store __attribute__((section(".data")));
struct buffer_store tv_store __attribute__((section(".data")));
+
+
+char gbl_common_data[0x20000] __attribute__((section(".data")));
+char * gbl_common_data_ptr __attribute__((section(".data"))) = gbl_common_data;
diff --git a/loader/src/plugin/ElfTools.cpp b/loader/src/plugin/ElfTools.cpp
index 0bf0fab..3d3055c 100644
--- a/loader/src/plugin/ElfTools.cpp
+++ b/loader/src/plugin/ElfTools.cpp
@@ -268,8 +268,21 @@ bool ElfTools::elfLink(Elf *elf, size_t shndx, void *destination, Elf32_Sym *sym
break;
}
case SHN_COMMON: {
- DEBUG_FUNCTION_LINE("case SHN_COMMON\n");
- return false;
+ u32 align = symtab[symbol].st_value;
+ u32 size = symtab[symbol].st_size;
+
+ uint32_t address = pluginData->getMemoryForCommonBySymbol(symbol, align, size);
+ if(address == NULL){
+ DEBUG_FUNCTION_LINE("Failed to get memory for common relocation\n");
+ return false;
+ }
+
+ if (!ElfTools::elfLinkOne(ELF32_R_TYPE(rela[i].r_info), rela[i].r_offset,rela[i].r_addend, destination, address)) {
+ DEBUG_FUNCTION_LINE("elfLinkOne failed\n");
+ return false;
+ }
+
+ break;
}
case SHN_UNDEF: {
if (allow_globals) {
diff --git a/loader/src/plugin/PluginData.cpp b/loader/src/plugin/PluginData.cpp
new file mode 100644
index 0000000..be62055
--- /dev/null
+++ b/loader/src/plugin/PluginData.cpp
@@ -0,0 +1,43 @@
+/****************************************************************************
+ * Copyright (C) 2018 Maschell
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ ****************************************************************************/
+
+#include
+#include
+#include