xref: /netbsd/lib/csu/common/compident.S (revision 41a0fea4)
1*41a0fea4Smartin/* $NetBSD: compident.S,v 1.4 2016/05/01 08:33:14 martin Exp $ */
2350c876fSmartin
3350c876fSmartin/*-
4350c876fSmartin * Copyright (c) 2002, 2008 The NetBSD Foundation, Inc.
5350c876fSmartin * All rights reserved.
6350c876fSmartin *
7350c876fSmartin * This code is derived from software contributed to The NetBSD Foundation
8350c876fSmartin * by Martin Husemann <martin@NetBSD.org>.
9350c876fSmartin *
10350c876fSmartin * Redistribution and use in source and binary forms, with or without
11350c876fSmartin * modification, are permitted provided that the following conditions
12350c876fSmartin * are met:
13350c876fSmartin * 1. Redistributions of source code must retain the above copyright
14350c876fSmartin *    notice, this list of conditions and the following disclaimer.
15350c876fSmartin * 2. Redistributions in binary form must reproduce the above copyright
16350c876fSmartin *    notice, this list of conditions and the following disclaimer in the
17350c876fSmartin *    documentation and/or other materials provided with the distribution.
18350c876fSmartin *
19350c876fSmartin * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20350c876fSmartin * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21350c876fSmartin * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22350c876fSmartin * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23350c876fSmartin * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24350c876fSmartin * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25350c876fSmartin * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26350c876fSmartin * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27350c876fSmartin * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28350c876fSmartin * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29350c876fSmartin * POSSIBILITY OF SUCH DAMAGE.
30350c876fSmartin */
31350c876fSmartin
32350c876fSmartin
33350c876fSmartin/*
34350c876fSmartin * This file is used to generate a note describing the code model in use by
35350c876fSmartin * the compiler on some architectures where this has consequences for the
36350c876fSmartin * VA layout applied by the kernel. On sparc64 the topdown VA layout can
37350c876fSmartin * only be enabled for processes compiled with -mcmodel=medany or greater,
38350c876fSmartin * but not for processes without this note or -mcmodel=medlow.
39350c876fSmartin *
40350c876fSmartin * The note looks similar to the .note.netbsd.march note used (for example)
41350c876fSmartin * on arm to note the ABI used by the process.
42350c876fSmartin *
43350c876fSmartin * [NOTE HEADER]
44350c876fSmartin *	long		name size
45350c876fSmartin *	long		content size
46350c876fSmartin *	long		note type
47350c876fSmartin *
48350c876fSmartin * [NOTE DATUM]
49350c876fSmartin *	string		code model (for sparc64: medlow, medmid, medany,
50350c876fSmartin *			the embedany model is never PIC, so not used here)
51350c876fSmartin *
52350c876fSmartin * The DATUM fields should be padded out such that their actual (not
53350c876fSmartin * declared) sizes % 4 == 0.
54350c876fSmartin */
55350c876fSmartin
56350c876fSmartin#include "sysident_assym.h"
57350c876fSmartin
58*41a0fea4Smartin	.section .note.netbsd.mcmodel,"MG",@note,3*4+CONTENTLENGTH+ELF_NOTE_MCMODEL_NAMESZ+1,comdat
59350c876fSmartin	.p2align 2
60350c876fSmartin
61350c876fSmartin	.long	ELF_NOTE_MCMODEL_NAMESZ
62350c876fSmartin	.long	CONTENTLENGTH
63350c876fSmartin	.long	ELF_NOTE_TYPE_MCMODEL_TAG
64350c876fSmartin	.ascii	"NetBSD\0\0"
65350c876fSmartin	.ascii	CONTENT
66c9d1a35bSjoerg	.p2align 2
67