phdr.c revision 9273:9a0603d78ad3
1270866Simp/* 2270866Simp * CDDL HEADER START 3270866Simp * 4270866Simp * The contents of this file are subject to the terms of the 5270866Simp * Common Development and Distribution License (the "License"). 6270866Simp * You may not use this file except in compliance with the License. 7270866Simp * 8270866Simp * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9270866Simp * or http://www.opensolaris.org/os/licensing. 10270866Simp * See the License for the specific language governing permissions 11270866Simp * and limitations under the License. 12270866Simp * 13270866Simp * When distributing Covered Code, include this CDDL HEADER in each 14270866Simp * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15270866Simp * If applicable, add the following below this CDDL HEADER, with the 16270866Simp * fields enclosed by brackets "[]" replaced with your own identifying 17270866Simp * information: Portions Copyright [yyyy] [name of copyright owner] 18270866Simp * 19270866Simp * CDDL HEADER END 20270866Simp */ 21270866Simp 22270866Simp/* 23270866Simp * Copyright 2009 Sun Microsystems, Inc. All rights reserved. 24270866Simp * Use is subject to license terms. 25270866Simp */ 26270866Simp 27270866Simp#include <sgs.h> 28270866Simp#include <_debug.h> 29270866Simp#include <conv.h> 30270866Simp#include <msg.h> 31270866Simp 32270866Simpvoid 33270866SimpElf_phdr(Lm_list *lml, uchar_t osabi, Half mach, Phdr *phdr) 34270866Simp{ 35270866Simp Conv_inv_buf_t inv_buf; 36270866Simp Conv_phdr_flags_buf_t phdr_flags_buf; 37270866Simp 38270866Simp dbg_print(lml, MSG_ORIG(MSG_PHD_VADDR), EC_ADDR(phdr->p_vaddr), 39270866Simp conv_phdr_flags(osabi, phdr->p_flags, 0, &phdr_flags_buf)); 40270866Simp dbg_print(lml, MSG_ORIG(MSG_PHD_PADDR), EC_ADDR(phdr->p_paddr), 41270866Simp conv_phdr_type(osabi, mach, phdr->p_type, 0, &inv_buf)); 42270866Simp dbg_print(lml, MSG_ORIG(MSG_PHD_FILESZ), EC_XWORD(phdr->p_filesz), 43270866Simp EC_XWORD(phdr->p_memsz)); 44270866Simp dbg_print(lml, MSG_ORIG(MSG_PHD_OFFSET), EC_OFF(phdr->p_offset), 45270866Simp EC_XWORD(phdr->p_align)); 46270866Simp} 47270866Simp