public inbox for elfutils@sourceware.org
 help / color / mirror / Atom feed
* [COMMITTED] elflint: Reject mergable string sections as relocation target.
@ 2015-10-16 11:25 Mark Wielaard
  0 siblings, 0 replies; only message in thread
From: Mark Wielaard @ 2015-10-16 11:25 UTC (permalink / raw)
  To: elfutils-devel

[-- Attachment #1: Type: text/plain, Size: 1376 bytes --]

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 | 5 +++++
 src/elflint.c | 5 +++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/ChangeLog b/src/ChangeLog
index f459e11..0d2b1d6 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -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
diff --git a/src/elflint.c b/src/elflint.c
index 0a6f0df..eada4d5 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));
 	}
     }
-- 
2.4.3


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2015-10-16 11:25 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-10-16 11:25 [COMMITTED] elflint: Reject mergable string sections as relocation target Mark Wielaard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).