--- gcc/config/m88k/sysv4.h 2018/04/24 18:10:23 1.1 +++ gcc/config/m88k/sysv4.h 2018/04/24 18:27:39 1.1.1.4 @@ -1,8 +1,10 @@ /* Definitions of target machine for GNU compiler. Motorola 88100 in an 88open ABI environment. Copyright (C) 1990, 1991 Free Software Foundation, Inc. - Written by Ron Guilmette (rfg@ncd.com). + + Written by Ron Guilmette (rfg@netcom.com). Contributed to FSF by Network Computing Devices. + Other contributions by Vince Guarna (vguarna@urbana.mcd.mot.com), Ray Essick (essick@i88.isc.com), Wilson Tien (wtien@urbana.mcd.mot.com), and Tom Wood (Tom_Wood@NeXT.com) @@ -21,7 +23,8 @@ GNU General Public License for more deta You should have received a copy of the GNU General Public License along with GNU CC; see the file COPYING. If not, write to -the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */ +the Free Software Foundation, 59 Temple Place - Suite 330, +Boston, MA 02111-1307, USA. */ /* DWARF_DEBUGGING_INFO defined in svr4.h. */ @@ -48,7 +51,7 @@ the Free Software Foundation, 675 Mass A #undef CPP_PREDEFINES #define CPP_PREDEFINES \ - "-Dm88000 -Dm88k -Dunix -D__svr4__ -Amachine(m88k) -Acpu(m88k) -Asystem(unix)" + "-Dm88000 -Dm88k -Dunix -D__svr4__ -Amachine(m88k) -Acpu(m88k) -Asystem(unix) -Asystem(svr4)" /* For the AT&T SVR4 port, the function is _mcount. */ #undef FUNCTION_PROFILER @@ -58,7 +61,25 @@ the Free Software Foundation, 675 Mass A /* Override svr4.h and m88k.h. */ #undef INIT_SECTION_ASM_OP #define INIT_SECTION_ASM_OP "section\t.init,\"xa\",#progbits" +#undef FINI_SECTION_ASM_OP +#define FINI_SECTION_ASM_OP "section\t.fini,\"xa\",#progbits" + +/* Define the pseudo-ops used to switch to the .ctors and .dtors sections. + + Note that we want to give these sections the SHF_WRITE attribute + because these sections will actually contain data (i.e. tables of + addresses of functions in the current root executable or shared library + file) and, in the case of a shared library, the relocatable addresses + will have to be properly resolved/relocated (and then written into) by + the dynamic linker when it actually attaches the given shared library + to the executing process. (Note that on SVR4, you may wish to use the + `-z text' option to the ELF linker, when building a shared library, as + an additional check that you are doing everything right. But if you do + use the `-z text' option when building a shared library, you will get + errors unless the .ctors and .dtors sections are marked as writable + via the SHF_WRITE attribute.) */ + #undef CTORS_SECTION_ASM_OP -#define CTORS_SECTION_ASM_OP "section\t.ctors,\"a\",#progbits" +#define CTORS_SECTION_ASM_OP "section\t.ctors,\"aw\"" #undef DTORS_SECTION_ASM_OP -#define DTORS_SECTION_ASM_OP "section\t.dtors,\"a\",#progbits" +#define DTORS_SECTION_ASM_OP "section\t.dtors,\"aw\""