xref: /illumos-gate/usr/src/test/bhyve-tests/tests/common/Mapfile.payload (revision dd72704bd9e794056c558153663c739e2012d721)
1#
2# CDDL HEADER START
3#
4# This file and its contents are supplied under the terms of the
5# Common Development and Distribution License ("CDDL"), version 1.0.
6# You may only use this file in accordance with the terms of version
7# 1.0 of the CDDL.
8#
9# A full copy of the text of the CDDL should have accompanied this
10# source.  A copy of the CDDL is also available via the Internet at
11# http://www.illumos.org/license/CDDL.
12#
13# CDDL HEADER END
14#
15
16#
17# Copyright 2022 Oxide Computer Company
18#
19
20$mapfile_version 2
21
22# The .eh_frame data was ending up in front of the .text segment, causing issues
23# when the guest attempted to start its payload
24NULL_SEGMENT discard {
25	ASSIGN_SECTION eh_discard {
26		IS_NAME = .eh_frame;
27	};
28};
29
30LOAD_SEGMENT payload {
31	FLAGS = READ WRITE EXECUTE;
32	VADDR = 0x800000;
33	PADDR = 0x800000;
34	ALIGN = 0x1000;
35
36	# Make sure that payload_start.s`_start is the first thing in .text segment,
37	# since when we "boot", that is where we want to begin running.
38	ASSIGN_SECTION is_start_text {
39		IS_NAME = .text;
40		FILE_BASENAME = payload_start.o;
41	};
42	ASSIGN_SECTION is_text {
43		IS_NAME = .text;
44	};
45	ASSIGN_SECTION is_alloc {
46		FLAGS = ALLOC;
47	};
48	IS_ORDER = is_start_text is_text is_alloc;
49};
50