cie->lsda_encoding = *data++;
if (!cie->sized_augmentation_data)
cie->fde_augmentation_data_size
- += encoded_value_size (cache->data, cache->e_ident,
+ += encoded_value_size (&cache->data->d, cache->e_ident,
cie->lsda_encoding, NULL);
continue;
case 'P': /* Skip personality routine. */
encoding = *data++;
- data += encoded_value_size (cache->data, cache->e_ident,
+ data += encoded_value_size (&cache->data->d, cache->e_ident,
encoding, data);
continue;
Dwarf_Off next_offset = offset;
Dwarf_CFI_Entry entry;
int result = INTUSE(dwarf_next_cfi) (cache->e_ident,
- cache->data, cache->eh_frame,
+ &cache->data->d, cache->eh_frame,
offset, &next_offset, &entry);
if (result != 0 || entry.cie.CIE_id != CIE_ID)
{
? 4 : 8);
Dwarf_Block block;
- const uint8_t *p = fs->cache->data->d_buf + reg->value;
+ const uint8_t *p = fs->cache->data->d.d_buf + reg->value;
get_uleb128 (block.length, p);
block.data = (void *) p;
Dwarf_CFI *cfi = libdw_typed_alloc (dbg, Dwarf_CFI);
cfi->eh_frame = dbg->sectiondata[IDX_debug_frame] == NULL;
- cfi->data = dbg->sectiondata[cfi->eh_frame ? IDX_eh_frame
- : IDX_debug_frame];
- cfi->elf = dbg->elf;
+ cfi->data = (Elf_Data_Scn *) dbg->sectiondata[cfi->eh_frame ? IDX_eh_frame
+ : IDX_debug_frame];
cfi->search_table = NULL;
cfi->search_table_vaddr = 0;
return NULL;
}
- cfi->elf = elf;
cfi->e_ident = (unsigned char *) elf_getident (elf, NULL);
if (cfi->e_ident == NULL)
{
return (void *) -1l;
/* Dummy used by read_encoded_value. */
- Elf_Data dummy_cfi_hdr_data = { .d_buf = (void *) hdr, .d_size = hdr_size };
+ Elf_Data_Scn dummy_cfi_hdr_data =
+ {
+ .d = { .d_buf = (void *) hdr, .d_size = hdr_size }
+ };
Dwarf_CFI dummy_cfi =
{
.e_ident = ehdr->e_ident,
Dwarf_CFI *cfi = allocate_cfi (elf, eh_frame_ptr);
if (cfi != NULL)
{
- cfi->data = data;
+ cfi->data = (Elf_Data_Scn *) data;
if (search_table != NULL)
{
Dwarf_CFI *cfi = allocate_cfi (elf, shdr->sh_addr);
if (cfi != NULL)
{
- cfi->data = data;
+ cfi->data = (Elf_Data_Scn *) data;
if (hdr_scn != NULL)
{
Elf_Data *hdr_data = elf_rawdata (hdr_scn, NULL);
}
static Dwarf_Addr __attribute__ ((unused))
-read_encoded_value (const Dwarf_CFI *cache,
- uint8_t encoding, const uint8_t **p)
+read_encoded_value (const Dwarf_CFI *cache, uint8_t encoding, const uint8_t **p)
{
Dwarf_Addr base = 0;
switch (encoding & 0x70)
case DW_EH_PE_absptr:
break;
case DW_EH_PE_pcrel:
- base = cache->frame_vaddr + (*p - (const uint8_t *) cache->data->d_buf);
+ base = cache->frame_vaddr + (*p - (const uint8_t *) cache->data->d.d_buf);
break;
case DW_EH_PE_textrel:
// ia64: segrel
const size_t address_size
= cache->e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
size_t align = ((cache->frame_vaddr
- + (*p - (const uint8_t *) cache->data->d_buf))
+ + (*p - (const uint8_t *) cache->data->d.d_buf))
& (address_size - 1));
if (align != 0)
*p += address_size - align;
Dwarf_CFI_Entry entry;
Dwarf_Off next_offset;
int result = INTUSE(dwarf_next_cfi) (cache->e_ident,
- cache->data, cache->eh_frame,
+ &cache->data->d, cache->eh_frame,
offset, &next_offset, &entry);
if (result != 0)
{
static Dwarf_Off
binary_search_fde (Dwarf_CFI *cache, Dwarf_Addr address)
{
- const size_t size = 2 * encoded_value_size (cache->data, cache->e_ident,
+ const size_t size = 2 * encoded_value_size (&cache->data->d, cache->e_ident,
cache->search_table_encoding,
NULL);
-
/* Dummy used by read_encoded_value. */
Dwarf_CFI dummy_cfi =
{
Dwarf_Off last_offset = cache->next_offset;
Dwarf_CFI_Entry entry;
int result = INTUSE(dwarf_next_cfi) (cache->e_ident,
- cache->data, cache->eh_frame,
+ &cache->data->d, cache->eh_frame,
last_offset, &cache->next_offset,
&entry);
if (result > 0)
case DW_CFA_expression:
get_uleb128 (regno, program);
- offset = program - (const uint8_t *) cache->data->d_buf;
+ offset = program - (const uint8_t *) cache->data->d.d_buf;
/* DW_FORM_block is a ULEB128 length followed by that many bytes. */
get_uleb128 (operand, program);
cfi_assert (operand <= (Dwarf_Word) (end - program));
case DW_CFA_val_expression:
get_uleb128 (regno, program);
/* DW_FORM_block is a ULEB128 length followed by that many bytes. */
- offset = program - (const uint8_t *) cache->data->d_buf;
+ offset = program - (const uint8_t *) cache->data->d.d_buf;
get_uleb128 (operand, program);
cfi_assert (operand <= (Dwarf_Word) (end - program));
program += operand;
/* Make sure we have a backend handle cached. */
if (unlikely (cache->ebl == NULL))
{
- cache->ebl = ebl_openbackend (cache->elf);
+ cache->ebl = ebl_openbackend (cache->data->s->elf);
if (unlikely (cache->ebl == NULL))
cache->ebl = (void *) -1l;
}
#define _UNWINDP_H 1
#include "libdwP.h"
+#include "libelfP.h"
#include "unwind.h" /* XXX */
struct ebl;
struct Dwarf_CFI_s
{
/* Data of the .debug_frame or .eh_frame section. */
- Elf_Data *data;
+ Elf_Data_Scn *data;
const unsigned char *e_ident; /* For EI_DATA and EI_CLASS. */
/* True if the file has a byte order different from the host. */
/* True if the section data is in .eh_frame format. */
bool eh_frame;
- Elf *elf; /* Originating ELF file. */
-
Dwarf_Addr frame_vaddr; /* DW_EH_PE_pcrel, address of frame section. */
Dwarf_Addr textrel; /* DW_EH_PE_textrel base address. */
Dwarf_Addr datarel; /* DW_EH_PE_datarel base address. */