4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
24 */
25
26 #ifndef _RELOC_DOT_H
27 #define _RELOC_DOT_H
28
29 #if defined(_KERNEL)
30 #include <sys/bootconf.h>
31 #include <sys/kobj.h>
32 #include <sys/kobj_impl.h>
33 #else
34 #include <rtld.h>
35 #include <conv.h>
36 #endif /* _KERNEL */
37
38 #include "reloc_defs.h"
39
40 #ifdef __cplusplus
41 extern "C" {
42 #endif
43
257 _kobj_printf(ops, MSG_REL_NONALIGN, EC_OFF((off)))
258
259 #define REL_ERR_UNNOBITS(lml, file, sym, rtype, nbits) \
260 _kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
261 _kobj_printf(ops, MSG_REL_FILE, (file)); \
262 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \
263 _kobj_printf(ops, MSG_REL_UNNOBITS, (nbits))
264
265 #define REL_ERR_LOSEBITS(lml, file, sym, rtype, uvalue, nbits, off) \
266 _kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
267 _kobj_printf(ops, MSG_REL_FILE, (file)); \
268 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \
269 _kobj_printf(ops, MSG_REL_VALUE, EC_XWORD((uvalue))); \
270 _kobj_printf(ops, MSG_REL_LOSEBITS, (int)(nbits)); \
271 _kobj_printf(ops, MSG_REL_OFFSET, EC_NATPTR((off)))
272
273 #define REL_ERR_NOFIT(lml, file, sym, rtype, uvalue) \
274 _kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
275 _kobj_printf(ops, MSG_REL_FILE, (file)); \
276 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \
277 _kobj_printf(ops, MSG_REL_NOFIT, EC_XWORD((uvalue)))
278
279
280 #else /* !_KERNEL */
281
282 extern const char *demangle(const char *);
283
284 #define REL_ERR_UNIMPL(lml, file, sym, rtype) \
285 (eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_UNIMPL), (file), \
286 ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), (int)(rtype)))
287
288 #define REL_ERR_UNSUPSZ(lml, file, sym, rtype, size) \
289 (eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_UNSUPSZ), \
290 conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
291 ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), (int)(size)))
292
293 #define REL_ERR_NONALIGN(lml, file, sym, rtype, off) \
294 (eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_NONALIGN), \
295 conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
296 ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), EC_OFF((off))))
297
|
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
7 *
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
12 *
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
18 *
19 * CDDL HEADER END
20 */
21
22 /*
23 * Copyright (c) 1995, 2010, Oracle and/or its affiliates. All rights reserved.
24 *
25 * Copyright 2020 Joyent, Inc.
26 */
27
28 #ifndef _RELOC_DOT_H
29 #define _RELOC_DOT_H
30
31 #if defined(_KERNEL)
32 #include <sys/bootconf.h>
33 #include <sys/kobj.h>
34 #include <sys/kobj_impl.h>
35 #else
36 #include <rtld.h>
37 #include <conv.h>
38 #endif /* _KERNEL */
39
40 #include "reloc_defs.h"
41
42 #ifdef __cplusplus
43 extern "C" {
44 #endif
45
259 _kobj_printf(ops, MSG_REL_NONALIGN, EC_OFF((off)))
260
261 #define REL_ERR_UNNOBITS(lml, file, sym, rtype, nbits) \
262 _kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
263 _kobj_printf(ops, MSG_REL_FILE, (file)); \
264 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \
265 _kobj_printf(ops, MSG_REL_UNNOBITS, (nbits))
266
267 #define REL_ERR_LOSEBITS(lml, file, sym, rtype, uvalue, nbits, off) \
268 _kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
269 _kobj_printf(ops, MSG_REL_FILE, (file)); \
270 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \
271 _kobj_printf(ops, MSG_REL_VALUE, EC_XWORD((uvalue))); \
272 _kobj_printf(ops, MSG_REL_LOSEBITS, (int)(nbits)); \
273 _kobj_printf(ops, MSG_REL_OFFSET, EC_NATPTR((off)))
274
275 #define REL_ERR_NOFIT(lml, file, sym, rtype, uvalue) \
276 _kobj_printf(ops, MSG_REL_PREGEN, CONV_RELOC_TYPE((rtype))); \
277 _kobj_printf(ops, MSG_REL_FILE, (file)); \
278 _kobj_printf(ops, MSG_REL_SYM, ((sym) ? (sym) : MSG_STR_UNKNOWN)); \
279 _kobj_printf(ops, MSG_REL_NOFIT, (u_longlong_t)EC_XWORD((uvalue)))
280
281
282 #else /* !_KERNEL */
283
284 extern const char *demangle(const char *);
285
286 #define REL_ERR_UNIMPL(lml, file, sym, rtype) \
287 (eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_UNIMPL), (file), \
288 ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), (int)(rtype)))
289
290 #define REL_ERR_UNSUPSZ(lml, file, sym, rtype, size) \
291 (eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_UNSUPSZ), \
292 conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
293 ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), (int)(size)))
294
295 #define REL_ERR_NONALIGN(lml, file, sym, rtype, off) \
296 (eprintf(lml, ERR_FATAL, MSG_INTL(MSG_REL_NONALIGN), \
297 conv_reloc_type_static(M_MACH, (rtype), 0), (file), \
298 ((sym) ? demangle(sym) : MSG_INTL(MSG_STR_UNKNOWN)), EC_OFF((off))))
299
|