1#
2# Copyright (c) 1993, 2010, Oracle and/or its affiliates. All rights reserved.
3#
4# CDDL HEADER START
5#
6# The contents of this file are subject to the terms of the
7# Common Development and Distribution License (the "License").
8# You may not use this file except in compliance with the License.
9#
10# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
11# or http://www.opensolaris.org/os/licensing.
12# See the License for the specific language governing permissions
13# and limitations under the License.
14#
15# When distributing Covered Code, include this CDDL HEADER in each
16# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
17# If applicable, add the following below this CDDL HEADER, with the
18# fields enclosed by brackets "[]" replaced with your own identifying
19# information: Portions Copyright [yyyy] [name of copyright owner]
20#
21# CDDL HEADER END
22#
23# A default mapfile for optimizing the creation of a filter shared object.
24# Creates a single, read-only, executable text segment to catch all loadable
25# sections.
26#
27# Filters that consist solely of a symbol table can be built directly from
28# ld(1) so that no .init/.fini sections are created.  Although the filter can
29# be constructed as a single read-only segment, the execute attribute of the
30# segment is maintained to allow for simple .init processing (i.e., .init
31# processing that requires no relocations), and to accommodate older versions
32# of dbx that produce warning messages if they find objects without traditional
33# text segments.
34#
35# If a filter is required to execute .init code that references global data
36# then the filter will require relocation (i.e., it will have to be written to
37# by ld.so.1).  Filters of this sort should *not* use this mapfile.
38#
39# This compaction of a filter into a single segment allows ld.so.1 to optimize
40# its processing of a filter.  If the filter is small enough this segment may
41# be handled in a single page mapping (for example libdl.so.1).
42#
43# The assignment of all allocatable sections to this segment insures that the
44# .dynamic, and any .data or .bss sections, become part of the text.  Note that
45# the compiler has a habit of generating empty .data and .bss sections.
46#
47# Override the default alignment so that this single paged object can be mapped
48# more flexibly.
49
50$mapfile_version 2
51
52LOAD_SEGMENT filter {
53	FLAGS = READ EXECUTE;
54	ALIGN = 0x1000;
55	ASSIGN_SECTION {
56		FLAGS = ALLOC;
57	};
58};
59