summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMark Wielaard <[email protected]>2015-06-12 12:50:14 +0200
committerMark Wielaard <[email protected]>2015-06-14 23:09:56 +0200
commit65dc8001e4bd3084ddb658b8c28806008dcd7311 (patch)
treef868c326242ab8417045869eb2c790d7004a6f2a
parentb427a91ebe5a4672573814c072d124438c6c7eca (diff)
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 <[email protected]>
-rw-r--r--libebl/ChangeLog5
-rw-r--r--libebl/eblcheckreloctargettype.c18
2 files changed, 18 insertions, 5 deletions
diff --git a/libebl/ChangeLog b/libebl/ChangeLog
index 51ae60f2..4305cf6d 100644
--- a/libebl/ChangeLog
+++ b/libebl/ChangeLog
@@ -1,3 +1,8 @@
+2015-06-12 Mark Wielaard <[email protected]>
+
+ * eblcheckreloctargettype.c (ebl_check_reloc_target_type): Allow
+ SHT_INIT_ARRAY, SHT_FINI_ARRAY and SHT_PREINIT_ARRAY.
+
2015-05-17 Mark Wielaard <[email protected]>
* eblobjnote.c (ebl_object_note): If allocation buf is large, then
diff --git a/libebl/eblcheckreloctargettype.c b/libebl/eblcheckreloctargettype.c
index e135f8a3..e0d57c14 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;
+ }
}