xref: /titanic_52/usr/src/cmd/sgs/rtld/common/mapfile-order-gcc (revision cd3e933325e68e23516a196a8fea7f49b1e497c3)
17c478bd9Sstevel@tonic-gate#
27c478bd9Sstevel@tonic-gate# CDDL HEADER START
37c478bd9Sstevel@tonic-gate#
47c478bd9Sstevel@tonic-gate# The contents of this file are subject to the terms of the
55aefb655Srie# Common Development and Distribution License (the "License").
65aefb655Srie# You may not use this file except in compliance with the License.
77c478bd9Sstevel@tonic-gate#
87c478bd9Sstevel@tonic-gate# You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
97c478bd9Sstevel@tonic-gate# or http://www.opensolaris.org/os/licensing.
107c478bd9Sstevel@tonic-gate# See the License for the specific language governing permissions
117c478bd9Sstevel@tonic-gate# and limitations under the License.
127c478bd9Sstevel@tonic-gate#
137c478bd9Sstevel@tonic-gate# When distributing Covered Code, include this CDDL HEADER in each
147c478bd9Sstevel@tonic-gate# file and include the License file at usr/src/OPENSOLARIS.LICENSE.
157c478bd9Sstevel@tonic-gate# If applicable, add the following below this CDDL HEADER, with the
167c478bd9Sstevel@tonic-gate# fields enclosed by brackets "[]" replaced with your own identifying
177c478bd9Sstevel@tonic-gate# information: Portions Copyright [yyyy] [name of copyright owner]
187c478bd9Sstevel@tonic-gate#
197c478bd9Sstevel@tonic-gate# CDDL HEADER END
207c478bd9Sstevel@tonic-gate#
215aefb655Srie
225aefb655Srie#
23*cd3e9333SAli Bahrami# Copyright (c) 2004, 2010, Oracle and/or its affiliates. All rights reserved.
245aefb655Srie#
257c478bd9Sstevel@tonic-gate# Note: This mapfile is used to place r_debug as the
267c478bd9Sstevel@tonic-gate# very first data item inside of the run-time linker.
277c478bd9Sstevel@tonic-gate# This is required for the ld.so.1 <--> rtld_db bootstraping
287c478bd9Sstevel@tonic-gate# for debuggers.
297c478bd9Sstevel@tonic-gate#
307c478bd9Sstevel@tonic-gate# The issue with this is that gcc/devpro do not agree on the
317c478bd9Sstevel@tonic-gate# name of the section this data should be placed in.  So -
327c478bd9Sstevel@tonic-gate# we must have a mapfile for each.
337c478bd9Sstevel@tonic-gate#
347c478bd9Sstevel@tonic-gate# If you update this file - make sure you update
357c478bd9Sstevel@tonic-gate# the matching file:
367c478bd9Sstevel@tonic-gate#
377c478bd9Sstevel@tonic-gate#	gcc mapfile:	rtld/common/mapfile-order-gcc
387c478bd9Sstevel@tonic-gate#	devpro mapfile: rtld/common/mapfile-order-devpro
397c478bd9Sstevel@tonic-gate#
407c478bd9Sstevel@tonic-gate
41*cd3e9333SAli Bahrami$mapfile_version 2
42*cd3e9333SAli Bahrami
43*cd3e9333SAli BahramiLOAD_SEGMENT data {
44*cd3e9333SAli Bahrami	FLAGS = READ WRITE EXECUTE;
45*cd3e9333SAli Bahrami
46*cd3e9333SAli Bahrami	# .data.rel sections from pics/debugdata.o go to data segment
47*cd3e9333SAli Bahrami	ASSIGN_SECTION dbg_data {
48*cd3e9333SAli Bahrami		IS_NAME = .data.rel;
49*cd3e9333SAli Bahrami		FILE_PATH = pics/debugdata.o;
50*cd3e9333SAli Bahrami	};
51*cd3e9333SAli Bahrami
52*cd3e9333SAli Bahrami	# Put .data.rel sections from pics/debugdata.o ahead of any other
53*cd3e9333SAli Bahrami	# .data.rel input sections in the .data.rel output section.
54*cd3e9333SAli Bahrami	IS_ORDER = dbg_data;
55*cd3e9333SAli Bahrami
56*cd3e9333SAli Bahrami	# Put .data.rel output section at top of data segment
57*cd3e9333SAli Bahrami	OS_ORDER = .data.rel;
58*cd3e9333SAli Bahrami};
59