xref: /illumos-gate/usr/src/cmd/sgs/liblddbg/common/phdr.c (revision 4f680cc6)
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 
227c478bd9Sstevel@tonic-gate /*
23*4f680cc6SAli Bahrami  * Copyright 2009 Sun Microsystems, Inc.  All rights reserved.
245aefb655Srie  * Use is subject to license terms.
257c478bd9Sstevel@tonic-gate  */
267c478bd9Sstevel@tonic-gate 
275aefb655Srie #include	<sgs.h>
285aefb655Srie #include	<_debug.h>
295aefb655Srie #include	<conv.h>
305aefb655Srie #include	<msg.h>
317c478bd9Sstevel@tonic-gate 
327c478bd9Sstevel@tonic-gate void
Elf_phdr(Lm_list * lml,uchar_t osabi,Half mach,Phdr * phdr)33*4f680cc6SAli Bahrami Elf_phdr(Lm_list *lml, uchar_t osabi, Half mach, Phdr *phdr)
347c478bd9Sstevel@tonic-gate {
35de777a60Sab 	Conv_inv_buf_t		inv_buf;
36de777a60Sab 	Conv_phdr_flags_buf_t	phdr_flags_buf;
37de777a60Sab 
385aefb655Srie 	dbg_print(lml, MSG_ORIG(MSG_PHD_VADDR), EC_ADDR(phdr->p_vaddr),
39*4f680cc6SAli Bahrami 	    conv_phdr_flags(osabi, phdr->p_flags, 0, &phdr_flags_buf));
405aefb655Srie 	dbg_print(lml, MSG_ORIG(MSG_PHD_PADDR), EC_ADDR(phdr->p_paddr),
41*4f680cc6SAli Bahrami 	    conv_phdr_type(osabi, mach, phdr->p_type, 0, &inv_buf));
425aefb655Srie 	dbg_print(lml, MSG_ORIG(MSG_PHD_FILESZ), EC_XWORD(phdr->p_filesz),
437c478bd9Sstevel@tonic-gate 	    EC_XWORD(phdr->p_memsz));
445aefb655Srie 	dbg_print(lml, MSG_ORIG(MSG_PHD_OFFSET), EC_OFF(phdr->p_offset),
457c478bd9Sstevel@tonic-gate 	    EC_XWORD(phdr->p_align));
467c478bd9Sstevel@tonic-gate }
47