summaryrefslogtreecommitdiffstats
path: root/libdw/dwarf_getcfi_elf.c
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2020-11-01 23:45:32 +0100
committerMark Wielaard <[email protected]>2020-11-01 23:45:32 +0100
commit8dd97a0a871672b3f7a58e1fb50b6f7195d8f32d (patch)
tree3a86d4fb1d7abf6966ff94a1e25f13f7e1809c48 /libdw/dwarf_getcfi_elf.c
parent50a6eeef7d87623faa65126dc3d16c2a8e613aea (diff)
parentb503c358dde835d8a1ae3ebd4968755ff396f814 (diff)
Merge tag 'elfutils-0.182' into mjw/RH-DTSdts-0.182
elfutils 0.182 release
Diffstat (limited to 'libdw/dwarf_getcfi_elf.c')
-rw-r--r--libdw/dwarf_getcfi_elf.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/libdw/dwarf_getcfi_elf.c b/libdw/dwarf_getcfi_elf.c
index adcaea03..c0e3cadd 100644
--- a/libdw/dwarf_getcfi_elf.c
+++ b/libdw/dwarf_getcfi_elf.c
@@ -41,7 +41,7 @@
static Dwarf_CFI *
-allocate_cfi (Elf *elf, GElf_Addr vaddr)
+allocate_cfi (Elf *elf, const GElf_Ehdr *ehdr, GElf_Addr vaddr)
{
Dwarf_CFI *cfi = calloc (1, sizeof *cfi);
if (cfi == NULL)
@@ -58,6 +58,8 @@ allocate_cfi (Elf *elf, GElf_Addr vaddr)
return NULL;
}
+ cfi->e_machine = ehdr->e_machine;
+
if ((BYTE_ORDER == LITTLE_ENDIAN && cfi->e_ident[EI_DATA] == ELFDATA2MSB)
|| (BYTE_ORDER == BIG_ENDIAN && cfi->e_ident[EI_DATA] == ELFDATA2LSB))
cfi->other_byte_order = true;
@@ -172,7 +174,7 @@ getcfi_gnu_eh_frame (Elf *elf, const GElf_Ehdr *ehdr, const GElf_Phdr *phdr)
__libdw_seterrno (DWARF_E_INVALID_ELF); /* XXX might be read error */
return NULL;
}
- Dwarf_CFI *cfi = allocate_cfi (elf, eh_frame_ptr);
+ Dwarf_CFI *cfi = allocate_cfi (elf, ehdr, eh_frame_ptr);
if (cfi != NULL)
{
cfi->data = (Elf_Data_Scn *) data;
@@ -222,7 +224,7 @@ getcfi_scn_eh_frame (Elf *elf, const GElf_Ehdr *ehdr,
__libdw_seterrno (DWARF_E_INVALID_ELF);
return NULL;
}
- Dwarf_CFI *cfi = allocate_cfi (elf, shdr->sh_addr);
+ Dwarf_CFI *cfi = allocate_cfi (elf, ehdr, shdr->sh_addr);
if (cfi != NULL)
{
cfi->data = (Elf_Data_Scn *) data;