aboutsummaryrefslogtreecommitdiff
path: root/gdb/dwarf2read.c
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/dwarf2read.c')
-rw-r--r--gdb/dwarf2read.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c
index 03c7855..7ed4253 100644
--- a/gdb/dwarf2read.c
+++ b/gdb/dwarf2read.c
@@ -8076,6 +8076,8 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym,
{
struct objfile *objfile = cu->objfile;
struct comp_unit_head *cu_header = &cu->header;
+ enum bfd_endian byte_order = bfd_big_endian (objfile->obfd) ?
+ BFD_ENDIAN_BIG : BFD_ENDIAN_LITTLE;
struct dwarf_block *blk;
switch (attr->form)
@@ -8091,7 +8093,7 @@ dwarf2_const_value (struct attribute *attr, struct symbol *sym,
/* NOTE: cagney/2003-05-09: In-lined store_address call with
it's body - store_unsigned_integer. */
store_unsigned_integer (SYMBOL_VALUE_BYTES (sym), cu_header->addr_size,
- DW_ADDR (attr));
+ DW_ADDR (attr), byte_order);
SYMBOL_CLASS (sym) = LOC_CONST_BYTES;
break;
case DW_FORM_string: