eh_frame.c (7c478bd9) | eh_frame.c (7257d1b4) |
---|---|
1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the | 1/* 2 * CDDL HEADER START 3 * 4 * The contents of this file are subject to the terms of the |
5 * Common Development and Distribution License, Version 1.0 only 6 * (the "License"). You may not use this file except in compliance 7 * with the License. | 5 * Common Development and Distribution License (the "License"). 6 * You may not use this file except in compliance with the License. |
8 * 9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 10 * or http://www.opensolaris.org/os/licensing. 11 * See the License for the specific language governing permissions 12 * and limitations under the License. 13 * 14 * When distributing Covered Code, include this CDDL HEADER in each 15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 16 * If applicable, add the following below this CDDL HEADER, with the 17 * fields enclosed by brackets "[]" replaced with your own identifying 18 * information: Portions Copyright [yyyy] [name of copyright owner] 19 * 20 * CDDL HEADER END 21 */ | 7 * 8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 9 * or http://www.opensolaris.org/os/licensing. 10 * See the License for the specific language governing permissions 11 * and limitations under the License. 12 * 13 * When distributing Covered Code, include this CDDL HEADER in each 14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 15 * If applicable, add the following below this CDDL HEADER, with the 16 * fields enclosed by brackets "[]" replaced with your own identifying 17 * information: Portions Copyright [yyyy] [name of copyright owner] 18 * 19 * CDDL HEADER END 20 */ |
21 |
|
22/* | 22/* |
23 * Copyright 2005 Sun Microsystems, Inc. All rights reserved. | 23 * Copyright 2008 Sun Microsystems, Inc. All rights reserved. |
24 * Use is subject to license terms. 25 */ 26 27#pragma ident "%Z%%M% %I% %E% SMI" 28 29/* 30 * interface used by unwind support to query frame descriptor info 31 */ 32 33#ifndef _LIBCRUN_ | 24 * Use is subject to license terms. 25 */ 26 27#pragma ident "%Z%%M% %I% %E% SMI" 28 29/* 30 * interface used by unwind support to query frame descriptor info 31 */ 32 33#ifndef _LIBCRUN_ |
34#include "synonyms.h" | 34#include "lint.h" |
35#endif 36#include <sys/types.h> 37#include <limits.h> 38#include "stack_unwind.h" 39#include "unwind_context.h" 40#include <dlfcn.h> 41 42/* --- 44 unchanged lines hidden (view full) --- 87 uint64_t range = 0; 88 _Unwind_Personality_Fn pfn = 0; 89 void* lsda = 0; 90 91 /* here is where data mapping would happen ??REMOTE?? */ 92 fde_data = ctx->fde; 93 data = fde_data; 94 fde_end = (void *)(((intptr_t)fde_data) + 4 + | 35#endif 36#include <sys/types.h> 37#include <limits.h> 38#include "stack_unwind.h" 39#include "unwind_context.h" 40#include <dlfcn.h> 41 42/* --- 44 unchanged lines hidden (view full) --- 87 uint64_t range = 0; 88 _Unwind_Personality_Fn pfn = 0; 89 void* lsda = 0; 90 91 /* here is where data mapping would happen ??REMOTE?? */ 92 fde_data = ctx->fde; 93 data = fde_data; 94 fde_end = (void *)(((intptr_t)fde_data) + 4 + |
95 _Unw_get_val(&data, 0, UNUM32, 1, 1, 0)); | 95 _Unw_get_val(&data, 0, UNUM32, 1, 1, 0)); |
96 reloc = 0; 97 base = ((intptr_t)data) + reloc; 98 cie_data = (void *)(base - _Unw_get_val(&data, 0, UNUM32, 1, 1, 0)); 99 cdata = cie_data; 100 cie_end = (void *)(((intptr_t)cie_data) + 4 + | 96 reloc = 0; 97 base = ((intptr_t)data) + reloc; 98 cie_data = (void *)(base - _Unw_get_val(&data, 0, UNUM32, 1, 1, 0)); 99 cdata = cie_data; 100 cie_end = (void *)(((intptr_t)cie_data) + 4 + |
101 _Unw_get_val(&cdata, 0, UNUM32, 1, 1, 0)); | 101 _Unw_get_val(&cdata, 0, UNUM32, 1, 1, 0)); |
102 creloc = 0; 103 /* data mapping has happened */ 104 105 f->cie_ops_end = cie_end; 106 f->cie_reloc = creloc; 107 f->fde_ops_end = fde_end; 108 f->fde_reloc = reloc; 109 110 (void) _Unw_get_val(&cdata, creloc, UNUM32, 1, 1, 0); 111 (void) _Unw_get_val(&cdata, creloc, UNUM8, 1, 1, 0); 112 /* LINTED alignment */ 113 (*((uint64_t *)(&(augment[0])))) = | 102 creloc = 0; 103 /* data mapping has happened */ 104 105 f->cie_ops_end = cie_end; 106 f->cie_reloc = creloc; 107 f->fde_ops_end = fde_end; 108 f->fde_reloc = reloc; 109 110 (void) _Unw_get_val(&cdata, creloc, UNUM32, 1, 1, 0); 111 (void) _Unw_get_val(&cdata, creloc, UNUM8, 1, 1, 0); 112 /* LINTED alignment */ 113 (*((uint64_t *)(&(augment[0])))) = |
114 _Unw_get_val(&cdata, creloc, ZTSTRING, 1, 1, 0); | 114 _Unw_get_val(&cdata, creloc, ZTSTRING, 1, 1, 0); |
115 f->code_align = _Unw_get_val(&cdata, creloc, ULEB128, 1, 1, 0); 116 f->data_align = _Unw_get_val(&cdata, creloc, SLEB128, 1, 1, 0); 117 (void) _Unw_get_val(&cdata, creloc, UNUM8, 1, 1, 0); 118 if (augment[0] == 'z' && 119 (scratch = _Unw_get_val(&cdata, creloc, ULEB128, 1, 1, 0)) != 0) { 120 for (p = &(augment[1]); *p != 0; p++) { 121 switch (*p) { 122 case 'P': --- 243 unchanged lines hidden (view full) --- 366 * it must lie in the interval [pi,pj). That is, 367 * pi <= p < pj, if p exists. 368 */ 369 while (pi < pj) { 370 unsigned char *pr = 371 pi + (((pj - pi) >> (log_size + 1)) << log_size); 372 /* Don't use (pi+pj)>>1 */ 373 get_table_ent_val(pr, table_end, enc, reloc, base, | 115 f->code_align = _Unw_get_val(&cdata, creloc, ULEB128, 1, 1, 0); 116 f->data_align = _Unw_get_val(&cdata, creloc, SLEB128, 1, 1, 0); 117 (void) _Unw_get_val(&cdata, creloc, UNUM8, 1, 1, 0); 118 if (augment[0] == 'z' && 119 (scratch = _Unw_get_val(&cdata, creloc, ULEB128, 1, 1, 0)) != 0) { 120 for (p = &(augment[1]); *p != 0; p++) { 121 switch (*p) { 122 case 'P': --- 243 unchanged lines hidden (view full) --- 366 * it must lie in the interval [pi,pj). That is, 367 * pi <= p < pj, if p exists. 368 */ 369 while (pi < pj) { 370 unsigned char *pr = 371 pi + (((pj - pi) >> (log_size + 1)) << log_size); 372 /* Don't use (pi+pj)>>1 */ 373 get_table_ent_val(pr, table_end, enc, reloc, base, |
374 &range_start, &range_end, &fde); | 374 &range_start, &range_end, &fde); |
375 376 /* Return fde if tpc is in this range. */ 377 378 if (range_start <= pc && pc < range_end) { 379 return ((void*) fde); 380 } 381 382 if (range_start < pc) 383 pi = pr + (1 << log_size); 384 else 385 pj = pr; 386 } 387 return (0); 388} | 375 376 /* Return fde if tpc is in this range. */ 377 378 if (range_start <= pc && pc < range_end) { 379 return ((void*) fde); 380 } 381 382 if (range_start < pc) 383 pi = pr + (1 << log_size); 384 else 385 pj = pr; 386 } 387 return (0); 388} |