a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
cd3e933325e68e23516a196a8fea7f49b1e497c3Ali Bahrami# Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# CDDL HEADER START
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# The contents of this file are subject to the terms of the
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# Common Development and Distribution License (the "License").
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# You may not use this file except in compliance with the License.
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# or http://www.opensolaris.org/os/licensing.
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# See the License for the specific language governing permissions
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# and limitations under the License.
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# When distributing Covered Code, include this CDDL HEADER in each
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# If applicable, add the following below this CDDL HEADER, with the
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# fields enclosed by brackets "[]" replaced with your own identifying
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# information: Portions Copyright [yyyy] [name of copyright owner]
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# CDDL HEADER END
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# Link-editor mapfile to create a non-executable bss segment definition
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# within an executable. This mapfile is similar to map.noexdata that
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# can be used on x86 architectures to create a non-executable data
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# segment. On SPARC, the data segment contains a Procedure Linkage
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# Table (PLT) that must remain executable.
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# As the bss segment is extended by sbrk(2) to enlarge the heap, a
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# non-executable bss segment also results in a non-exutable heap.
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# The link-editor does not use this file automatically, so one must
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# use the -M option to cc or ld:
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# cc -M /usr/lib/ld/map.noexbss myprogram.c
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans#
cd3e933325e68e23516a196a8fea7f49b1e497c3Ali Bahrami
cd3e933325e68e23516a196a8fea7f49b1e497c3Ali Bahrami$mapfile_version 2
cd3e933325e68e23516a196a8fea7f49b1e497c3Ali Bahrami
cd3e933325e68e23516a196a8fea7f49b1e497c3Ali BahramiLOAD_SEGMENT bss {
cd3e933325e68e23516a196a8fea7f49b1e497c3Ali Bahrami FLAGS = READ WRITE;
cd3e933325e68e23516a196a8fea7f49b1e497c3Ali Bahrami};
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans
a4faba164aa153855d621c694fc5aa75dd183b81Rod Evans# See also /usr/lib/ld/map.noexdata.