openbsd.h (90075) | openbsd.h (117395) |
---|---|
1/* Base configuration file for all OpenBSD targets. 2 Copyright (C) 1999, 2000 Free Software Foundation, Inc. 3 4This file is part of GNU CC. 5 6GNU CC is free software; you can redistribute it and/or modify 7it under the terms of the GNU General Public License as published by 8the Free Software Foundation; either version 2, or (at your option) --- 161 unchanged lines hidden (view full) --- 170/* OpenBSD assembler is hacked to have .type & .size support even in a.out 171 format object files. Functions size are supported but not activated 172 yet (look for GRACE_PERIOD_EXPIRED in gas/config/obj-aout.c). 173 SET_ASM_OP is needed for attribute alias to work. */ 174 175#undef TYPE_ASM_OP 176#undef SIZE_ASM_OP 177#undef SET_ASM_OP | 1/* Base configuration file for all OpenBSD targets. 2 Copyright (C) 1999, 2000 Free Software Foundation, Inc. 3 4This file is part of GNU CC. 5 6GNU CC is free software; you can redistribute it and/or modify 7it under the terms of the GNU General Public License as published by 8the Free Software Foundation; either version 2, or (at your option) --- 161 unchanged lines hidden (view full) --- 170/* OpenBSD assembler is hacked to have .type & .size support even in a.out 171 format object files. Functions size are supported but not activated 172 yet (look for GRACE_PERIOD_EXPIRED in gas/config/obj-aout.c). 173 SET_ASM_OP is needed for attribute alias to work. */ 174 175#undef TYPE_ASM_OP 176#undef SIZE_ASM_OP 177#undef SET_ASM_OP |
178#undef GLOBAL_ASM_OP |
|
178 179#define TYPE_ASM_OP "\t.type\t" 180#define SIZE_ASM_OP "\t.size\t" 181#define SET_ASM_OP "\t.set\t" | 179 180#define TYPE_ASM_OP "\t.type\t" 181#define SIZE_ASM_OP "\t.size\t" 182#define SET_ASM_OP "\t.set\t" |
183#define GLOBAL_ASM_OP "\t.globl\t" |
|
182 183/* The following macro defines the format used to output the second 184 operand of the .type assembler directive. */ 185#undef TYPE_OPERAND_FMT 186#define TYPE_OPERAND_FMT "@%s" 187 188/* Provision if extra assembler code is needed to declare a function's result 189 (taken from svr4, not needed yet actually). */ --- 8 unchanged lines hidden (view full) --- 198 199#ifndef OBSD_HAS_DECLARE_FUNCTION_NAME 200/* Extra assembler code needed to declare a function properly. 201 Some assemblers may also need to also have something extra said 202 about the function's return value. We allow for that here. */ 203#undef ASM_DECLARE_FUNCTION_NAME 204#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 205 do { \ | 184 185/* The following macro defines the format used to output the second 186 operand of the .type assembler directive. */ 187#undef TYPE_OPERAND_FMT 188#define TYPE_OPERAND_FMT "@%s" 189 190/* Provision if extra assembler code is needed to declare a function's result 191 (taken from svr4, not needed yet actually). */ --- 8 unchanged lines hidden (view full) --- 200 201#ifndef OBSD_HAS_DECLARE_FUNCTION_NAME 202/* Extra assembler code needed to declare a function properly. 203 Some assemblers may also need to also have something extra said 204 about the function's return value. We allow for that here. */ 205#undef ASM_DECLARE_FUNCTION_NAME 206#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 207 do { \ |
206 fprintf (FILE, "%s", TYPE_ASM_OP); \ 207 assemble_name (FILE, NAME); \ 208 fputs (" , ", FILE); \ 209 fprintf (FILE, TYPE_OPERAND_FMT, "function"); \ 210 putc ('\n', FILE); \ | 208 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "function"); \ |
211 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ 212 ASM_OUTPUT_LABEL(FILE, NAME); \ 213 } while (0) 214#endif 215 216#ifndef OBSD_HAS_DECLARE_FUNCTION_SIZE 217/* Declare the size of a function. */ 218#undef ASM_DECLARE_FUNCTION_SIZE | 209 ASM_DECLARE_RESULT (FILE, DECL_RESULT (DECL)); \ 210 ASM_OUTPUT_LABEL(FILE, NAME); \ 211 } while (0) 212#endif 213 214#ifndef OBSD_HAS_DECLARE_FUNCTION_SIZE 215/* Declare the size of a function. */ 216#undef ASM_DECLARE_FUNCTION_SIZE |
219#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ 220 do { \ 221 if (!flag_inhibit_size_directive) \ 222 { \ 223 fprintf (FILE, "%s", SIZE_ASM_OP); \ 224 assemble_name (FILE, (FNAME)); \ 225 fputs (" , . - ", FILE); \ 226 assemble_name (FILE, (FNAME)); \ 227 putc ('\n', FILE); \ 228 } \ | 217#define ASM_DECLARE_FUNCTION_SIZE(FILE, FNAME, DECL) \ 218 do { \ 219 if (!flag_inhibit_size_directive) \ 220 ASM_OUTPUT_MEASURED_SIZE (FILE, FNAME); \ |
229 } while (0) 230#endif 231 232#ifndef OBSD_HAS_DECLARE_OBJECT 233/* Extra assembler code needed to declare an object properly. */ 234#undef ASM_DECLARE_OBJECT_NAME | 221 } while (0) 222#endif 223 224#ifndef OBSD_HAS_DECLARE_OBJECT 225/* Extra assembler code needed to declare an object properly. */ 226#undef ASM_DECLARE_OBJECT_NAME |
235#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ 236 do { \ 237 fprintf (FILE, "%s", TYPE_ASM_OP); \ 238 assemble_name (FILE, NAME); \ 239 fputs (" , ", FILE); \ 240 fprintf (FILE, TYPE_OPERAND_FMT, "object"); \ 241 putc ('\n', FILE); \ 242 size_directive_output = 0; \ 243 if (!flag_inhibit_size_directive && DECL_SIZE (DECL)) \ 244 { \ 245 size_directive_output = 1; \ 246 fprintf (FILE, "%s", SIZE_ASM_OP); \ 247 assemble_name (FILE, NAME); \ 248 fprintf (FILE, " , %d\n", int_size_in_bytes (TREE_TYPE (DECL)));\ 249 } \ 250 ASM_OUTPUT_LABEL (FILE, NAME); \ | 227#define ASM_DECLARE_OBJECT_NAME(FILE, NAME, DECL) \ 228 do { \ 229 HOST_WIDE_INT size; \ 230 ASM_OUTPUT_TYPE_DIRECTIVE (FILE, NAME, "object"); \ 231 size_directive_output = 0; \ 232 if (!flag_inhibit_size_directive \ 233 && (DECL) && DECL_SIZE (DECL)) \ 234 { \ 235 size_directive_output = 1; \ 236 size = int_size_in_bytes (TREE_TYPE (DECL)); \ 237 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, NAME, size); \ 238 } \ 239 ASM_OUTPUT_LABEL (FILE, NAME); \ |
251 } while (0) 252 253/* Output the size directive for a decl in rest_of_decl_compilation 254 in the case where we did not do so before the initializer. 255 Once we find the error_mark_node, we know that the value of 256 size_directive_output was set by ASM_DECLARE_OBJECT_NAME 257 when it was run for the same decl. */ 258#undef ASM_FINISH_DECLARE_OBJECT 259#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ 260do { \ 261 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ | 240 } while (0) 241 242/* Output the size directive for a decl in rest_of_decl_compilation 243 in the case where we did not do so before the initializer. 244 Once we find the error_mark_node, we know that the value of 245 size_directive_output was set by ASM_DECLARE_OBJECT_NAME 246 when it was run for the same decl. */ 247#undef ASM_FINISH_DECLARE_OBJECT 248#define ASM_FINISH_DECLARE_OBJECT(FILE, DECL, TOP_LEVEL, AT_END) \ 249do { \ 250 const char *name = XSTR (XEXP (DECL_RTL (DECL), 0), 0); \ |
251 HOST_WIDE_INT size; \ |
|
262 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ 263 && ! AT_END && TOP_LEVEL \ 264 && DECL_INITIAL (DECL) == error_mark_node \ 265 && !size_directive_output) \ 266 { \ 267 size_directive_output = 1; \ | 252 if (!flag_inhibit_size_directive && DECL_SIZE (DECL) \ 253 && ! AT_END && TOP_LEVEL \ 254 && DECL_INITIAL (DECL) == error_mark_node \ 255 && !size_directive_output) \ 256 { \ 257 size_directive_output = 1; \ |
268 fprintf (FILE, "%s", SIZE_ASM_OP); \ 269 assemble_name (FILE, name); \ 270 fprintf (FILE, " , %d\n", int_size_in_bytes (TREE_TYPE (DECL)));\ | 258 size = int_size_in_bytes (TREE_TYPE (DECL)); \ 259 ASM_OUTPUT_SIZE_DIRECTIVE (FILE, name, size); \ |
271 } \ 272 } while (0) 273#endif 274 275 276/* Those are `generic' ways to weaken/globalize a label. We shouldn't need 277 to override a processor specific definition. Hence, #ifndef ASM_* 278 In case overriding turns out to be needed, one can always #undef ASM_* 279 before including this file. */ 280 281/* Tell the assembler that a symbol is weak. */ 282/* Note: netbsd arm32 assembler needs a .globl here. An override may 283 be needed when/if we go for arm32 support. */ 284#ifndef ASM_WEAKEN_LABEL 285#define ASM_WEAKEN_LABEL(FILE,NAME) \ 286 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \ 287 fputc ('\n', FILE); } while (0) 288#endif | 260 } \ 261 } while (0) 262#endif 263 264 265/* Those are `generic' ways to weaken/globalize a label. We shouldn't need 266 to override a processor specific definition. Hence, #ifndef ASM_* 267 In case overriding turns out to be needed, one can always #undef ASM_* 268 before including this file. */ 269 270/* Tell the assembler that a symbol is weak. */ 271/* Note: netbsd arm32 assembler needs a .globl here. An override may 272 be needed when/if we go for arm32 support. */ 273#ifndef ASM_WEAKEN_LABEL 274#define ASM_WEAKEN_LABEL(FILE,NAME) \ 275 do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \ 276 fputc ('\n', FILE); } while (0) 277#endif |
289 290/* Tell the assembler that a symbol is global. */ 291#ifndef ASM_GLOBALIZE_LABEL 292#define ASM_GLOBALIZE_LABEL(FILE,NAME) \ 293 do { fputs ("\t.globl\t", FILE); assemble_name (FILE, NAME); \ 294 fputc ('\n', FILE); } while(0) 295#endif 296 | |
297 298/* Storage layout. */ 299 300 301/* Otherwise, since we support weak, gthr.h erroneously tries to use 302 #pragma weak. */ 303#define GTHREAD_USE_WEAK 0 304 305/* bug work around: we don't want to support #pragma weak, but the current 306 code layout needs HANDLE_PRAGMA_WEAK asserted for __attribute((weak)) to 307 work. On the other hand, we don't define HANDLE_PRAGMA_WEAK directly, 308 as this depends on a few other details as well... */ | 278 279/* Storage layout. */ 280 281 282/* Otherwise, since we support weak, gthr.h erroneously tries to use 283 #pragma weak. */ 284#define GTHREAD_USE_WEAK 0 285 286/* bug work around: we don't want to support #pragma weak, but the current 287 code layout needs HANDLE_PRAGMA_WEAK asserted for __attribute((weak)) to 288 work. On the other hand, we don't define HANDLE_PRAGMA_WEAK directly, 289 as this depends on a few other details as well... */ |
309#define HANDLE_SYSV_PRAGMA | 290#define HANDLE_SYSV_PRAGMA 1 |
310 | 291 |