]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
elflint: Reject mergable string sections as relocation target.
authorMark Wielaard <mjw@redhat.com>
Fri, 16 Oct 2015 11:15:01 +0000 (13:15 +0200)
committerMark Wielaard <mjw@redhat.com>
Fri, 16 Oct 2015 11:15:01 +0000 (13:15 +0200)
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 <mjw@redhat.com>
src/ChangeLog
src/elflint.c

index f459e117c442800d3bab35bb47230de74c4315ba..0d2b1d61f16e4234df13e3e84095068b21bdb139 100644 (file)
@@ -1,3 +1,8 @@
+2015-10-16  Mark Wielaard  <mjw@redhat.com>
+
+       * elflint.c (check_reloc_shdr): Reject only desthdrs if they have both
+       SHF_MERGE and SHF_STRINGS set.
+
 2015-10-13  Jose E. Marchesi  <jose.marchesi@oracle.com>
 
        * elflint.c (check_sections): Do not rely on
index 0a6f0df37bc4ab3921d0c7638ca1e52b5fa00710..eada4d5016309db15f92f1f7fe0242ca0ece8d04 100644 (file)
@@ -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));
        }
     }