--- gcc/config/i386v.h 2018/04/24 17:51:35 1.1 +++ gcc/config/i386v.h 2018/04/24 17:59:34 1.1.1.3 @@ -39,6 +39,8 @@ the Free Software Foundation, 675 Mass A "%{pg:gcrt1.o%s}%{!pg:%{posix:%{p:mcrtp1.o%s}%{!p:crtp1.o%s}}%{!posix:%{p:mcrt1.o%s}%{!p:crt1.o%s}}} crtbegin.o%s\ %{p:-L/usr/lib/libp}%{pg:-L/usr/lib/libp}" +/* ??? There is a suggestion that -lg is needed here. + Does anyone know whether this is right? */ #define LIB_SPEC "%{posix:-lcposix} %{shlib:-lc_s} -lc crtend.o%s crtn.o%s" /* Specify predefined symbols in preprocessor. */ @@ -96,27 +98,39 @@ the Free Software Foundation, 675 Mass A #undef FRAME_POINTER_REQUIRED #define FRAME_POINTER_REQUIRED \ (current_function_calls_setjmp || current_function_calls_longjmp) + +/* Modify ASM_OUTPUT_LOCAL slightly to test -msvr3-shlib. */ +#undef ASM_OUTPUT_LOCAL +#define ASM_OUTPUT_LOCAL(FILE, NAME, SIZE, ROUNDED) \ + do { \ + int align = exact_log2 (ROUNDED); \ + if (align > 2) align = 2; \ + if (TARGET_SVR3_SHLIB) \ + data_section (); \ + else \ + bss_section (); \ + ASM_OUTPUT_ALIGN ((FILE), align == -1 ? 2 : align); \ + ASM_OUTPUT_LABEL ((FILE), (NAME)); \ + fprintf ((FILE), "\t.set .,.+%u\n", (ROUNDED)); \ + } while (0) -/* Define a few machine-specific details - of the implementation of constructors. +/* Define a few machine-specific details of the implementation of + constructors. - CTORS_SECTION_ASM_OP should be defined to concatenate - the macro INIT_SECTION_ASM_OP, a newline, and a push instruction - to push a word containing 0 (or some equivalent of that). + The __CTORS_LIST__ goes in the .init section. Define CTOR_LIST_BEGIN + and CTOR_LIST_END to contribute to the .init section an instruction to + push a word containing 0 (or some equivalent of that). - ASM_OUTPUT_CONSTRUCTOR should be defined - to push the address of the constructor. */ + ASM_OUTPUT_CONSTRUCTOR should be defined to push the address of the + constructor. */ #undef INIT_SECTION_ASM_OP #define INIT_SECTION_ASM_OP ".section .init,\"x\"" -#define CTORS_SECTION_ASM_OP \ - INIT_SECTION_ASM_OP "\n" \ - "\tpushl $0\n\t" \ - DATA_SECTION_ASM_OP -/* The reason we end with DATA_SECTION_ASM_OP is to prevent the - initial and final table elements (see crtstuff.c) from getting into - the .init section and causing a crash. */ +#define CTOR_LIST_BEGIN \ + asm (INIT_SECTION_ASM_OP); \ + asm ("pushl $0") +#define CTOR_LIST_END CTOR_LIST_BEGIN #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME) \ do { \