From: Mark Wielaard Date: Fri, 16 Oct 2015 10:26:27 +0000 (+0200) Subject: ppc: ppc_check_special_symbol): Also allow _SDA_BASE_ in .data section. X-Git-Tag: elfutils-0.164~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fd2e84cb31fa7585baa7daa9dae03a8ac725ae05;p=thirdparty%2Felfutils.git ppc: ppc_check_special_symbol): Also allow _SDA_BASE_ in .data section. The Small Data Area Base normally points to .sdata, in which case we check it is at an offset of 0x8000. It might however fall in the .data section, in which case we cannot check the offset. The size always should be zero. Signed-off-by: Mark Wielaard --- diff --git a/backends/ChangeLog b/backends/ChangeLog index e6f376336..6ea3dc4bf 100644 --- a/backends/ChangeLog +++ b/backends/ChangeLog @@ -1,3 +1,8 @@ +2015-10-16 Mark Wielaard + + * ppc_symbol.c (ppc_check_special_symbol): Also allow _SDA_BASE_ + in .data section. + 2015-10-05 Josh Stone * Makefile.am (libebl_%.so): Add AM_V_at and AM_V_CCLD silencers. diff --git a/backends/ppc_symbol.c b/backends/ppc_symbol.c index 733114b6a..37d49182f 100644 --- a/backends/ppc_symbol.c +++ b/backends/ppc_symbol.c @@ -1,5 +1,5 @@ /* PPC specific symbolic name handling. - Copyright (C) 2004, 2005, 2007, 2014 Red Hat, Inc. + Copyright (C) 2004, 2005, 2007, 2014, 2015 Red Hat, Inc. This file is part of elfutils. Written by Ulrich Drepper , 2004. @@ -143,9 +143,14 @@ ppc_check_special_symbol (Elf *elf, GElf_Ehdr *ehdr, const GElf_Sym *sym, if (sname == NULL) return false; + /* Small data area. Normally points to .sdata, in which case we + check it is at an offset of 0x8000. It might however fall in the + .data section, in which case we cannot check the offset. The + size always should be zero. */ if (strcmp (name, "_SDA_BASE_") == 0) - return (strcmp (sname, ".sdata") == 0 - && sym->st_value == destshdr->sh_addr + 0x8000 + return (((strcmp (sname, ".sdata") == 0 + && sym->st_value == destshdr->sh_addr + 0x8000) + || strcmp (sname, ".data") == 0) && sym->st_size == 0); if (strcmp (name, "_SDA2_BASE_") == 0)