2010-06-16 Roland McGrath <roland@redhat.com>
+ * cie.c (intern_new_cie): Canonicalize DW_EH_PE_absptr FDE encoding to
+ either DW_EH_PE_udata8 or DW_EH_PE_udata4.
+
* encoded-value.h (read_encoded_value): Handle DW_EH_PE_indirect.
Don't assume DW_EH_PE_aligned refers to native address size.
/* CIE reading.
- Copyright (C) 2009 Red Hat, Inc.
+ Copyright (C) 2009-2010 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
#include "cfi.h"
#include "encoded-value.h"
+#include <assert.h>
#include <search.h>
#include <stdlib.h>
break;
}
+ if ((cie->fde_encoding & 0x0f) == DW_EH_PE_absptr)
+ {
+ /* Canonicalize encoding to a specific size. */
+ assert (DW_EH_PE_absptr == 0);
+
+ /* XXX should get from dwarf_next_cfi with v4 header. */
+ uint_fast8_t address_size
+ = cache->e_ident[EI_CLASS] == ELFCLASS32 ? 4 : 8;
+ switch (address_size)
+ {
+ case 8:
+ cie->fde_encoding |= DW_EH_PE_udata8;
+ break;
+ case 4:
+ cie->fde_encoding |= DW_EH_PE_udata4;
+ break;
+ default:
+ free (cie);
+ __libdw_seterrno (DWARF_E_INVALID_DWARF);
+ return NULL;
+ }
+ }
+
/* Save the initial instructions to be played out into initial state. */
cie->initial_instructions = info->initial_instructions;
cie->initial_instructions_end = info->initial_instructions_end;