xref: /freebsd/sys/compat/linux/linux_elf.h (revision 4d846d260e2b9a3d4d0a701462568268cbfe7a5b)
1447636e4SEdward Tomasz Napierala /*-
2*4d846d26SWarner Losh  * SPDX-License-Identifier: BSD-2-Clause
3447636e4SEdward Tomasz Napierala  *
4447636e4SEdward Tomasz Napierala  * Copyright (c) 2018 Chuck Tuffli
5447636e4SEdward Tomasz Napierala  *
6447636e4SEdward Tomasz Napierala  * Redistribution and use in source and binary forms, with or without
7447636e4SEdward Tomasz Napierala  * modification, are permitted provided that the following conditions
8447636e4SEdward Tomasz Napierala  * are met:
9447636e4SEdward Tomasz Napierala  * 1. Redistributions of source code must retain the above copyright
10447636e4SEdward Tomasz Napierala  *    notice, this list of conditions and the following disclaimer.
11447636e4SEdward Tomasz Napierala  * 2. Redistributions in binary form must reproduce the above copyright
12447636e4SEdward Tomasz Napierala  *    notice, this list of conditions and the following disclaimer in the
13447636e4SEdward Tomasz Napierala  *    documentation and/or other materials provided with the distribution.
14447636e4SEdward Tomasz Napierala  *
15447636e4SEdward Tomasz Napierala  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
16447636e4SEdward Tomasz Napierala  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
17447636e4SEdward Tomasz Napierala  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18447636e4SEdward Tomasz Napierala  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
19447636e4SEdward Tomasz Napierala  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
20447636e4SEdward Tomasz Napierala  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
21447636e4SEdward Tomasz Napierala  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22447636e4SEdward Tomasz Napierala  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
23447636e4SEdward Tomasz Napierala  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
24447636e4SEdward Tomasz Napierala  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
25447636e4SEdward Tomasz Napierala  * SUCH DAMAGE.
26447636e4SEdward Tomasz Napierala  */
27447636e4SEdward Tomasz Napierala 
28447636e4SEdward Tomasz Napierala #ifndef _COMPAT_LINUX_ELF_H_
29447636e4SEdward Tomasz Napierala #define _COMPAT_LINUX_ELF_H_
30447636e4SEdward Tomasz Napierala 
3174465145SDmitry Chagin struct note_info_list;
32447636e4SEdward Tomasz Napierala 
3374465145SDmitry Chagin /* Linux core notes are labeled "CORE" */
3474465145SDmitry Chagin #define	LINUX_ABI_VENDOR	"CORE"
35447636e4SEdward Tomasz Napierala 
3695b86034SDmitry Chagin /* Elf notes */
3795b86034SDmitry Chagin #define	GNU_ABI_VENDOR		"GNU"
3895b86034SDmitry Chagin #define	GNU_ABI_LINUX		0
3995b86034SDmitry Chagin 
4074465145SDmitry Chagin /* This adds "linux32_" and "linux64_" prefixes. */
4174465145SDmitry Chagin #define	__linuxN(x)	__CONCAT(__CONCAT(__CONCAT(linux,__ELF_WORD_SIZE),_),x)
4274465145SDmitry Chagin 
4374465145SDmitry Chagin void 	__linuxN(prepare_notes)(struct thread *, struct note_info_list *,
4474465145SDmitry Chagin 	    size_t *);
457d8c9839SDmitry Chagin void	__linuxN(arch_copyout_auxargs)(struct image_params *, Elf_Auxinfo **);
467d8c9839SDmitry Chagin int	__linuxN(copyout_auxargs)(struct image_params *, uintptr_t);
476039e966SDmitry Chagin int	__linuxN(copyout_strings)(struct image_params *, uintptr_t *);
4895b86034SDmitry Chagin bool	linux_trans_osrel(const Elf_Note *note, int32_t *osrel);
49447636e4SEdward Tomasz Napierala 
50447636e4SEdward Tomasz Napierala #endif
51