@@ -1174,8 +1174,15 @@ static const struct sectioncheck *section_mismatch(
* fromsec = text section
* refsymname = *.constprop.*
*
+ * Pattern 6:
+ * powerpc64 has boot functions that reference init, but must remain in text.
+ * This pattern is identified by
+ * tosec = init section
+ * fromsym = <function list>
+ *
**/
-static int secref_whitelist(const struct sectioncheck *mismatch,
+static int secref_whitelist(const struct elf_info *elf,
+ const struct sectioncheck *mismatch,
const char *fromsec, const char *fromsym,
const char *tosec, const char *tosym)
{
@@ -1212,6 +1219,17 @@ static int secref_whitelist(const struct sectioncheck *mismatch,
match(fromsym, optim_symbols))
return 0;
+ /* Check for pattern 6 */
+ if (elf->hdr->e_machine == EM_PPC64)
+ if (match(tosec, init_sections) &&
+ (!strncmp(fromsym, "__boot_from_prom",
+ strlen("__boot_from_prom")) ||
+ !strncmp(fromsym, "start_here_multiplatform",
+ strlen("start_here_multiplatform")) ||
+ !strncmp(fromsym, "start_here_common",
+ strlen("start_here_common")))
+ return 0;
+
return 1;
}
@@ -1552,7 +1570,7 @@ static void default_mismatch_handler(const char *modname, struct elf_info *elf,
tosym = sym_name(elf, to);
/* check whitelist - we may ignore it */
- if (secref_whitelist(mismatch,
+ if (secref_whitelist(elf, mismatch,
fromsec, fromsym, tosec, tosym)) {
report_sec_mismatch(modname, mismatch,
fromsec, r->r_offset, fromsym,