summaryrefslogtreecommitdiffstats
path: root/meta
diff options
context:
space:
mode:
Diffstat (limited to 'meta')
-rw-r--r--meta/classes/insane.bbclass26
1 files changed, 25 insertions, 1 deletions
diff --git a/meta/classes/insane.bbclass b/meta/classes/insane.bbclass
index d51d1a1e00..34bcd98e8d 100644
--- a/meta/classes/insane.bbclass
+++ b/meta/classes/insane.bbclass
@@ -113,7 +113,7 @@ def package_qa_get_machine_dict():
113 113
114 114
115# Currently not being used by default "desktop" 115# Currently not being used by default "desktop"
116WARN_QA ?= "ldflags useless-rpaths rpaths unsafe-references-in-binaries unsafe-references-in-scripts staticdev libdir xorg-driver-abi" 116WARN_QA ?= "ldflags useless-rpaths rpaths unsafe-references-in-binaries unsafe-references-in-scripts staticdev libdir xorg-driver-abi textrel"
117ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms dep-cmp" 117ERROR_QA ?= "dev-so debug-deps dev-deps debug-files arch la2 pkgconfig la perms dep-cmp"
118 118
119ALL_QA = "${WARN_QA} ${ERROR_QA}" 119ALL_QA = "${WARN_QA} ${ERROR_QA}"
@@ -446,6 +446,30 @@ def package_qa_check_desktop(path, name, d, elf, messages):
446 for l in output: 446 for l in output:
447 messages.append("Desktop file issue: " + l.strip()) 447 messages.append("Desktop file issue: " + l.strip())
448 448
449QAPATHTEST[textrel] = "package_qa_textrel"
450def package_qa_textrel(path, name, d, elf, messages):
451 """
452 Check if the binary contains relocations in .text
453 """
454
455 if not elf:
456 return
457
458 if os.path.islink(path):
459 return
460
461 phdrs = elf.run_objdump("-p", d)
462 sane = True
463
464 import re
465 textrel_re = re.compile("\s+TEXTREL\s+")
466 for line in phdrs.split("\n"):
467 if textrel_re.match(line):
468 sane = False
469
470 if not sane:
471 messages.append("ELF binary '%s' has relocations in .text" % path)
472
449QAPATHTEST[ldflags] = "package_qa_hash_style" 473QAPATHTEST[ldflags] = "package_qa_hash_style"
450def package_qa_hash_style(path, name, d, elf, messages): 474def package_qa_hash_style(path, name, d, elf, messages):
451 """ 475 """