1# 2# Copyright (c) 2004, 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# Link-editor mapfile to create a non-executable data segment definition 24# within an executable. Note that this only functions properly on the 25# x86 architecture. On SPARC, the data segment contains a Procedure Linkage 26# Table (PLT) that must remain executable. 27# 28# As the data segment is extended by sbrk(2) to enlarge the heap, a 29# non-executable data segment also results in a non-exutable heap. 30# 31# The link-editor does not use this file automatically, so one must use the 32# -M option to cc or ld: 33# 34# cc -M /usr/lib/ld/map.noexdata myprogram.c 35# 36 37# 38# Executables can also create a separate non-executable bss segment. 39# This segment may use additional memory, but also results in a 40# non-executable heap. See /usr/lib/ld/map.noexbss. 41# 42# See also /usr/lib/ld/map.execdata. 43 44$mapfile_version 2 45 46$if _sparc 47 48$error SPARC Procedure Linkage Table (PLT) must remain executable 49 50$elif _x86 51 52LOAD_SEGMENT data { FLAGS = READ WRITE }; 53 54$else 55$error unknown platform 56$endif 57