summaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authormidipix <writeonce@midipix.org>2019-02-08 12:17:22 -0500
committermidipix <writeonce@midipix.org>2019-02-17 22:35:52 -0500
commit1b1487d3a6c086cb01bf4520229d58314e6a37e2 (patch)
tree8ba943767ec6fc16ec03eccc93fb67f85cd1624d /gcc
parenta02b4135412d664bc39a8a2e4ebeddc344afc888 (diff)
downloadcbb-gcc-4.6.4-1b1487d3a6c086cb01bf4520229d58314e6a37e2.tar.bz2
cbb-gcc-4.6.4-1b1487d3a6c086cb01bf4520229d58314e6a37e2.tar.xz
midipix targets: create .got entries in .dsosyms, support interposition.
Diffstat (limited to 'gcc')
-rw-r--r--gcc/config/i386/midipix.c34
-rw-r--r--gcc/config/i386/midipix.h16
2 files changed, 28 insertions, 22 deletions
diff --git a/gcc/config/i386/midipix.c b/gcc/config/i386/midipix.c
index 4b29c0917..0d81e0d25 100644
--- a/gcc/config/i386/midipix.c
+++ b/gcc/config/i386/midipix.c
@@ -144,23 +144,32 @@ static void midipix_pe_create_got_entry(FILE * stream, const char * name, tree d
if ((visibility == VISIBILITY_PROTECTED) || (visibility == VISIBILITY_INTERNAL))
return;
+ /* dsostrs$... */
fputs("\n",stream);
fputs(GAS_SECTION,stream);
+ fputs(GOTSTRS_SECTION_NAME,stream);
+ fputs("$",stream);
+ assemble_name(stream,name);
+ fputs(GOT_SECTION_ATTR,stream);
- if (decl->decl_with_vis.weak_flag) {
- fputs(GOT_SECTION_NAME,stream);
-
- } else if (decl->decl_with_vis.visibility == VISIBILITY_INTERNAL) {
- fputs(INTERNAL_SECTION_NAME,stream);
-
- } else {
- fputs(GOT_SECTION_NAME,stream);
- }
+ /* .symstr_... */
+ fputs("\n.symstr_",stream);
+ assemble_name(stream,name);
+ fputs(":\n\t",stream);
+ fputs(".ascii\t\"",stream);
+ assemble_name(stream,name);
+ fputs("\\0\"\n",stream);
+ fputs("\t.linkonce discard\n\n",stream);
+ /* dsosyms$... */
+ fputs("\n",stream);
+ fputs(GAS_SECTION,stream);
+ fputs(GOTSYMS_SECTION_NAME,stream);
fputs("$",stream);
assemble_name(stream,name);
fputs(GOT_SECTION_ATTR,stream);
+ /* __imp_... */
fputs("\n\t.global __imp_",stream);
assemble_name(stream,name);
fputs("\n__imp_",stream);
@@ -169,8 +178,11 @@ static void midipix_pe_create_got_entry(FILE * stream, const char * name, tree d
fputs(ptrsize,stream);
fputs("\t",stream);
assemble_name(stream,name);
- fputs("\n",stream);
- fputs("\t.linkonce discard\n\n",stream);
+ fputs("\n\t",stream);
+ fputs(ptrsize,stream);
+ fputs("\t.symstr_",stream);
+ assemble_name(stream,name);
+ fputs("\n\t.linkonce discard\n\n",stream);
}
diff --git a/gcc/config/i386/midipix.h b/gcc/config/i386/midipix.h
index de9166582..f87cdc5c5 100644
--- a/gcc/config/i386/midipix.h
+++ b/gcc/config/i386/midipix.h
@@ -181,21 +181,15 @@
#undef RODATA_SECTION_NAME
#define RODATA_SECTION_NAME ".rdata,\"r\""
-#undef GOT_SECTION_NAME
-#define GOT_SECTION_NAME ".got"
+#undef GOTSYMS_SECTION_NAME
+#define GOTSYMS_SECTION_NAME ".dsosyms"
+
+#undef GOTSTRS_SECTION_NAME
+#define GOTSTRS_SECTION_NAME ".gotstrs"
#undef GOTREFS_SECTION_NAME
#define GOTREFS_SECTION_NAME ".gotrefs"
-#undef PROTECTED_SECTION_NAME
-#define PROTECTED_SECTION_NAME GOT_SECTION_NAME
-
-#undef HIDDEN_SECTION_NAME
-#define HIDDEN_SECTION_NAME ".hidden"
-
-#undef INTERNAL_SECTION_NAME
-#define INTERNAL_SECTION_NAME ".intern"
-
#undef GOT_SECTION_ATTR
#define GOT_SECTION_ATTR ",\"r\""