10Sstevel@tonic-gate /* 20Sstevel@tonic-gate * CDDL HEADER START 30Sstevel@tonic-gate * 40Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*1618Srie * Common Development and Distribution License (the "License"). 6*1618Srie * You may not use this file except in compliance with the License. 70Sstevel@tonic-gate * 80Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 90Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 100Sstevel@tonic-gate * See the License for the specific language governing permissions 110Sstevel@tonic-gate * and limitations under the License. 120Sstevel@tonic-gate * 130Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 140Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 150Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 160Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 170Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 180Sstevel@tonic-gate * 190Sstevel@tonic-gate * CDDL HEADER END 200Sstevel@tonic-gate */ 211169Srie 220Sstevel@tonic-gate /* 23*1618Srie * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 241169Srie * Use is subject to license terms. 250Sstevel@tonic-gate */ 260Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 270Sstevel@tonic-gate 280Sstevel@tonic-gate #include <sys/types.h> 290Sstevel@tonic-gate #include "reloc.h" 300Sstevel@tonic-gate 311169Srie static const char *rels[R_386_NUM] = { 321169Srie "R_386_NONE", "R_386_32", 331169Srie "R_386_PC32", "R_386_GOT32", 341169Srie "R_386_PLT32", "R_386_COPY", 351169Srie "R_386_GLOB_DAT", "R_386_JMP_SLOT", 361169Srie "R_386_RELATIVE", "R_386_GOTOFF", 371169Srie "R_386_GOTPC", "R_386_32PLT", 381169Srie "R_386_TLS_GD_PLT", "R_386_TLS_LDM_PLT", 391169Srie "R_386_TLS_TPOFF", "R_386_TLS_IE", 401169Srie "R_386_TLS_GOTIE", "R_386_TLS_LE", 411169Srie "R_386_TLS_GD", "R_386_TLS_LDM", 421169Srie "R_386_16", "R_386_PC16", 431169Srie "R_386_8", "R_386_PC8", 441169Srie "R_386_UNKNOWN24", "R_386_UNKNOWN25", 451169Srie "R_386_UNKNOWN26", "R_386_UNKNOWN27", 461169Srie "R_386_UNKNOWN28", "R_386_UNKNOWN29", 471169Srie "R_386_UNKNOWN30", "R_386_UNKNOWN31", 481169Srie "R_386_TLS_LDO_32", "R_386_UNKNOWN33", 491169Srie "R_386_UNKNOWN34", "R_386_TLS_DTPMOD32", 501169Srie "R_386_TLS_DTPOFF32", "R_386_UNKNOWN37" 511169Srie }; 520Sstevel@tonic-gate 531169Srie #if (R_386_NUM != (R_386_UNKNOWN37 + 1)) 541169Srie #error "R_386_NUM has grown" 550Sstevel@tonic-gate #endif 560Sstevel@tonic-gate 570Sstevel@tonic-gate /* 581169Srie * This is a 'stub' of the orignal version defined in liblddbg.so. This stub 591169Srie * returns the 'int string' of the relocation in question instead of converting 601169Srie * the relocation to it's full syntax. 610Sstevel@tonic-gate */ 620Sstevel@tonic-gate const char * 63*1618Srie conv_reloc_386_type(Word type) 640Sstevel@tonic-gate { 651169Srie static char strbuf[32]; 661169Srie int ndx = 31; 671169Srie 681169Srie if (type < R_386_NUM) 691169Srie return (rels[type]); 701169Srie 711169Srie strbuf[ndx--] = '\0'; 721169Srie do { 731169Srie strbuf[ndx--] = '0' + (type % 10); 741169Srie type = type / 10; 751169Srie } while ((ndx >= (int)0) && (type > (Word)0)); 761169Srie 771169Srie return (&strbuf[ndx + 1]); 780Sstevel@tonic-gate } 79