From: Mark Wielaard Date: Fri, 16 Oct 2015 11:15:01 +0000 (+0200) Subject: elflint: Reject mergable string sections as relocation target. X-Git-Tag: elfutils-0.164~1 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=61c25a1c5b507629fa69b205a0e22d142092c6d1;p=thirdparty%2Felfutils.git elflint: Reject mergable string sections as relocation target. Mergable sections can be the target of a relocation, but only if they contain items of the same size. So only reject mergable string sections as target of a relocation section. Signed-off-by: Mark Wielaard --- diff --git a/src/ChangeLog b/src/ChangeLog index f459e117c..0d2b1d61f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2015-10-16 Mark Wielaard + + * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both + SHF_MERGE and SHF_STRINGS set. + 2015-10-13 Jose E. Marchesi * elflint.c (check_sections): Do not rely on diff --git a/src/elflint.c b/src/elflint.c index 0a6f0df37..eada4d501 100644 --- a/src/elflint.c +++ b/src/elflint.c @@ -1254,9 +1254,10 @@ section [%2d] '%s': sh_info should be zero\n"), } } - if (((*destshdrp)->sh_flags & (SHF_MERGE | SHF_STRINGS)) != 0) + if ((((*destshdrp)->sh_flags & SHF_MERGE) != 0) + && ((*destshdrp)->sh_flags & SHF_STRINGS) != 0) ERROR (gettext ("\ -section [%2d] '%s': no relocations for merge-able sections possible\n"), +section [%2d] '%s': no relocations for merge-able string sections possible\n"), idx, section_name (ebl, idx)); } }