[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH] create-diff-object: Handle missing secsym for debug sections


  • To: <xen-devel@xxxxxxxxxxxxx>
  • From: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Date: Wed, 8 Feb 2023 18:04:57 +0000
  • Authentication-results: esa1.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, <sergey.dyasli@xxxxxxxxxx>, Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
  • Delivery-date: Wed, 08 Feb 2023 18:05:29 +0000
  • Ironport-data: A9a23:hEMwmKuox9I2ik6kSEjD9gcxXufnVFleMUV32f8akzHdYApBsoF/q tZmKT3Vb66JNzOgKo9wbI2wph8EvsTVzoBjSwNupS89ECtB+JbJXdiXEBz9bniYRiHhoOCLz O1FM4Wdc5pkJpP4jk3wWlQ0hSAkjclkfpKlVKiffHg3HVQ+IMsYoUoLs/YjhYJ1isSODQqIu Nfjy+XSI1bg0DNvWo4uw/vrRChH4bKj51v0gnRkPaoQ5AWGxyFPZH4iDfrZw0XQE9E88tGSH 44v/JnhlkvF8hEkDM+Sk7qTWiXmlZaLYGBiIlIPM0STqkAqSh4ai87XB9JFAatjsB2bnsgZ9 Tl4ncfYpTHFnEH7sL91vxFwS0mSNEDdkVPNCSDXXce7lyUqf5ZwqhnH4Y5f0YAwo45K7W9yG fMweClQbAGAityM/vGaWtcv1p0KIsvOM9ZK0p1g5Wmx4fcORJnCR+PB5MNC3Sd2jcdLdRrcT 5NHM3w1Nk2GOkARfA5NU/rSn8/x7pX7Wydfs0nToaM47nLMxQh1+LPsLMDUapqBQsA9ckOw9 zyYpDSnWU9y2Nq322K18Firl+/0rQyhAqMiKpjl7NtnjwjGroAUIEJPDgbqyRWjsWauVtQaJ 0EK9y4Gqakp6FftXtT7GRqirxasvRkaQdNcVfI77AKlzbDd6AKUQGMDS1Z8hMcO7ZFsA2Zwj xnQwo2vXGY02FGIdZ6D3ueN8DGjOiUrF1FBRD86DltcytfhhY5m23ojUe1fOKKyi9T0HxT5z DaLsDUyit0vsCIb60mo1QuZ2mzx//AlWiZwv1yKBTz9smuVcab/P+SVBU7nAeGsxWpzZn2Ip zA6lseX94ji5rndxXXWEI3h8FxEjstp0QEwY3Y1R/HNFBz3oRZPmLy8BxkgTHqFyu5eJVfUj Lb74Gu9HqN7MnqwdrNQaImsEcksxqWIPY27Ca2LP4YQPMUrK1HvEMRSiai4hTiFfK8EyP5XB HtmWZz0USZy5VpPnFJauNvxIZd0n3tjlAs/tLjwzgi90Kr2WZJmYe5tDbd6VchgtPnsiFyMo 75i2z6il003vBvWPnOGrub+7DkicRAGOHwBg5UGLbDfelU4SAnMyZb5mNscRmCspIwN/s+gw 513chYGoLYjrRUr8Tm3V00=
  • Ironport-hdrordr: A9a23:K15wR6nlYRGaflI5jvXKVzCIa1fpDfLW3DAbv31ZSRFFG/Fw9/ rCoB3U73/JYVcqKRUdcLW7UpVoLkmyyXcY2+cs1NSZLWzbUQmTXeJfBOLZqlWNJ8SXzIVgPM xbAspD4bPLbGSTjazBkXSF+9RL+qj6zEh/792usEuETmtRGt9dBx8SMHf9LqXvLjM2fqbQEv Cnl6x6jgvlQ1s7ROKhCEIIWuDSzue77q4PMXY9dmcaABDlt0LR1ILH
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Certain debug sections like ".debug_aranges" when built with GCC 11.2.1
are missing section symbols (presumably because they're not needed).
Instead, of segfaulting, simply don't include them if they're missing.

Signed-off-by: Ross Lagerwall <ross.lagerwall@xxxxxxxxxx>
---
 create-diff-object.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/create-diff-object.c b/create-diff-object.c
index a516670..780e6c8 100644
--- a/create-diff-object.c
+++ b/create-diff-object.c
@@ -1484,7 +1484,7 @@ static void kpatch_include_debug_sections(struct 
kpatch_elf *kelf)
        list_for_each_entry(sec, &kelf->sections, list) {
                if (is_debug_section(sec)) {
                        sec->include = 1;
-                       if (!is_rela_section(sec))
+                       if (!is_rela_section(sec) && sec->secsym)
                                sec->secsym->include = 1;
                }
        }
-- 
2.31.1




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.