From 1b1487d3a6c086cb01bf4520229d58314e6a37e2 Mon Sep 17 00:00:00 2001 From: midipix Date: Fri, 8 Feb 2019 12:17:22 -0500 Subject: midipix targets: create .got entries in .dsosyms, support interposition. --- gcc/config/i386/midipix.c | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) (limited to 'gcc/config/i386/midipix.c') 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); } -- cgit v1.2.3