+2009-04-08 Roland McGrath <roland@redhat.com>
+
+ * relocate.c (__libdwfl_relocate_value): Don't adjust a value from
+ a non-SHF_ALLOC section.
+ (relocate_getsym): Test st_shndx for SHN_* values, not *SHNDX.
+ * dwfl_module_getsym.c (dwfl_module_getsym): Likewise.
+
2009-03-09 Roland McGrath <roland@redhat.com>
* dwfl_module_build_id.c (__libdwfl_find_build_id): Move SHSTRNDX
/* Find debugging and symbol information for a module in libdwfl.
- Copyright (C) 2006,2007 Red Hat, Inc.
+ Copyright (C) 2006,2007,2009 Red Hat, Inc.
This file is part of Red Hat elfutils.
Red Hat elfutils is free software; you can redistribute it and/or modify
if (shndxp != NULL)
*shndxp = shndx;
- switch (shndx)
+ switch (sym->st_shndx)
{
case SHN_ABS:
case SHN_UNDEF:
return DWFL_E_LIBELF;
}
- /* Apply the adjustment. */
- *value += refshdr->sh_addr + mod->main.bias;
+ if (refshdr->sh_flags & SHF_ALLOC)
+ /* Apply the adjustment. */
+ *value += refshdr->sh_addr + mod->main.bias;
+
return DWFL_E_NOERROR;
}
if (sym->st_shndx != SHN_XINDEX)
*shndx = sym->st_shndx;
- switch (*shndx)
+ switch (sym->st_shndx)
{
case SHN_ABS:
case SHN_UNDEF: