Skip to content

Commit 517001b

Browse files
committed
Update a few more freebsd headers
1 parent b3ff4d9 commit 517001b

File tree

4 files changed

+526
-336
lines changed

4 files changed

+526
-336
lines changed

amd64/bsd_asm.h

+18-20
Original file line numberDiff line numberDiff line change
@@ -30,15 +30,17 @@
3030
* SUCH DAMAGE.
3131
*
3232
* from: @(#)DEFS.h 5.1 (Berkeley) 4/23/90
33-
* $FreeBSD: src/sys/amd64/include/asm.h,v 1.18 2007/08/22 04:26:07 jkoshy Exp $
33+
* $FreeBSD$
3434
*/
3535

3636
#ifndef _MACHINE_ASM_H_
3737
#define _MACHINE_ASM_H_
3838

39+
3940
#ifdef __APPLE__
4041
#include "../i387/osx_asm.h"
4142
#define CNAME(x) EXT(x)
43+
4244
#else
4345
#include "bsd_cdefs.h"
4446

@@ -47,7 +49,6 @@
4749
#define PIC_GOT(x) x@GOTPCREL(%rip)
4850
#else
4951
#define PIC_PLT(x) x
50-
#define PIC_GOT(x) x
5152
#endif
5253

5354
/*
@@ -60,25 +61,10 @@
6061
#define CNAME(csym) csym
6162
#define HIDENAME(asmsym) .asmsym
6263

63-
#define _START_ENTRY .p2align 4,0x90
64+
#define _START_ENTRY .text; .p2align 4,0x90
6465

65-
#if defined(__ELF__)
66-
#define _ENTRY(x) .text; _START_ENTRY; \
66+
#define _ENTRY(x) _START_ENTRY; \
6767
.globl CNAME(x); .type CNAME(x),@function; CNAME(x):
68-
#define END(x) .size x, . - x
69-
70-
#elif defined(_WIN32)
71-
#ifndef _MSC_VER
72-
#define END(x) .end
73-
#define _START_ENTRY_WIN .text; _START_ENTRY
74-
#else
75-
#define END(x) end
76-
#define _START_ENTRY_WIN .code; _START_ENTRY
77-
#endif
78-
#define _ENTRY(x) _START_ENTRY_WIN; \
79-
.globl CNAME(x); .section .drectve; .ascii " -export:" #x; \
80-
.section .text; .def CNAME(x); .scl 2; .type 32; .endef; CNAME(x):
81-
#endif
8268

8369
#ifdef PROF
8470
#define ALTENTRY(x) _ENTRY(x); \
@@ -96,6 +82,19 @@
9682
#define ENTRY(x) _ENTRY(x)
9783
#endif
9884

85+
#define END(x) .size x, . - x
86+
87+
#endif /* __APPLE */
88+
89+
/*
90+
* WEAK_REFERENCE(): create a weak reference alias from sym.
91+
* The macro is not a general asm macro that takes arbitrary names,
92+
* but one that takes only C names. It does the non-null name
93+
* translation inside the macro.
94+
*/
95+
#define WEAK_REFERENCE(sym, alias) \
96+
.weak CNAME(alias); \
97+
.equ CNAME(alias),CNAME(sym)
9998

10099
#define RCSID(x) .text; .asciz x
101100

@@ -106,5 +105,4 @@
106105
#define __FBSDID(s) /* nothing */
107106
#endif /* not lint and not STRIP_FBSDID */
108107

109-
#endif
110108
#endif /* !_MACHINE_ASM_H_ */

0 commit comments

Comments
 (0)