From: Mark Wielaard Date: Fri, 12 Jun 2015 10:50:14 +0000 (+0200) Subject: libebl: SHT_(INIT|FINI|PREINIT)_ARRAY are valid targets for relocation. X-Git-Tag: elfutils-0.163~18 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=65dc8001e4bd3084ddb658b8c28806008dcd7311;p=thirdparty%2Felfutils.git libebl: SHT_(INIT|FINI|PREINIT)_ARRAY are valid targets for relocation. Seen in run-elflint-self.sh for size.o when build with --enable-gcov. https://bugzilla.redhat.com/show_bug.cgi?id=1230798 Signed-off-by: Mark Wielaard --- diff --git a/libebl/ChangeLog b/libebl/ChangeLog index 51ae60f2b..4305cf6dc 100644 --- a/libebl/ChangeLog +++ b/libebl/ChangeLog @@ -1,3 +1,8 @@ +2015-06-12 Mark Wielaard + + * eblcheckreloctargettype.c (ebl_check_reloc_target_type): Allow + SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY. + 2015-05-17 Mark Wielaard * eblobjnote.c (ebl_object_note): If allocation buf is large, then diff --git a/libebl/eblcheckreloctargettype.c b/libebl/eblcheckreloctargettype.c index e135f8a36..e0d57c144 100644 --- a/libebl/eblcheckreloctargettype.c +++ b/libebl/eblcheckreloctargettype.c @@ -1,5 +1,5 @@ /* Check whether a section type is a valid target for relocation. - Copyright (C) 2014 Red Hat, Inc. + Copyright (C) 2014, 2015 Red Hat, Inc. This file is part of elfutils. This file is free software; you can redistribute it and/or modify @@ -39,8 +39,16 @@ ebl_check_reloc_target_type (Ebl *ebl, Elf64_Word sh_type) if (ebl->check_reloc_target_type (ebl, sh_type)) return true; - if (sh_type == SHT_PROGBITS || sh_type == SHT_NOBITS) - return true; - - return false; + switch (sh_type) + { + case SHT_PROGBITS: + case SHT_NOBITS: + case SHT_INIT_ARRAY: + case SHT_FINI_ARRAY: + case SHT_PREINIT_ARRAY: + return true; + + default: + return false; + } }