All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] create-diff-object: Handle missing secsym for debug sections
@ 2023-02-08 18:04 Ross Lagerwall
  2023-02-09  8:46 ` Jan Beulich
  2023-02-15 13:51 ` Andrew Cooper
  0 siblings, 2 replies; 4+ messages in thread
From: Ross Lagerwall @ 2023-02-08 18:04 UTC (permalink / raw)
  To: xen-devel
  Cc: Konrad Rzeszutek Wilk, Andrew Cooper, sergey.dyasli, Ross Lagerwall

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@citrix.com>
---
 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



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] create-diff-object: Handle missing secsym for debug sections
  2023-02-08 18:04 [PATCH] create-diff-object: Handle missing secsym for debug sections Ross Lagerwall
@ 2023-02-09  8:46 ` Jan Beulich
  2023-02-13 17:36   ` Ross Lagerwall
  2023-02-15 13:51 ` Andrew Cooper
  1 sibling, 1 reply; 4+ messages in thread
From: Jan Beulich @ 2023-02-09  8:46 UTC (permalink / raw)
  To: Ross Lagerwall
  Cc: Konrad Rzeszutek Wilk, Andrew Cooper, sergey.dyasli, xen-devel

On 08.02.2023 19:04, Ross Lagerwall wrote:
> Certain debug sections like ".debug_aranges" when built with GCC 11.2.1
> are missing section symbols (presumably because they're not needed).

Is it really gcc (not gas) which controls whether section symbols are emitted
for a particular section?

Jan


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] create-diff-object: Handle missing secsym for debug sections
  2023-02-09  8:46 ` Jan Beulich
@ 2023-02-13 17:36   ` Ross Lagerwall
  0 siblings, 0 replies; 4+ messages in thread
From: Ross Lagerwall @ 2023-02-13 17:36 UTC (permalink / raw)
  To: Jan Beulich
  Cc: Konrad Rzeszutek Wilk, Andrew Cooper, Sergey Dyasli, xen-devel

> From: Jan Beulich <jbeulich@suse.com>
> Sent: Thursday, February 9, 2023 8:46 AM
> To: Ross Lagerwall <ross.lagerwall@citrix.com>
> Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>; Andrew Cooper <Andrew.Cooper3@citrix.com>; Sergey Dyasli <sergey.dyasli@citrix.com>; xen-devel@lists.xen.org <xen-devel@lists.xen.org>
> Subject: Re: [PATCH] create-diff-object: Handle missing secsym for debug sections 
>  
> On 08.02.2023 19:04, Ross Lagerwall wrote:
> > Certain debug sections like ".debug_aranges" when built with GCC 11.2.1
> > are missing section symbols (presumably because they're not needed).
> 
> Is it really gcc (not gas) which controls whether section symbols are emitted
> for a particular section?

You're right. I tested it and it is down to the gas version (2.36.1 in this
case). I'll fix that before pushing it.

Ross

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] create-diff-object: Handle missing secsym for debug sections
  2023-02-08 18:04 [PATCH] create-diff-object: Handle missing secsym for debug sections Ross Lagerwall
  2023-02-09  8:46 ` Jan Beulich
@ 2023-02-15 13:51 ` Andrew Cooper
  1 sibling, 0 replies; 4+ messages in thread
From: Andrew Cooper @ 2023-02-15 13:51 UTC (permalink / raw)
  To: Ross Lagerwall, xen-devel; +Cc: Konrad Rzeszutek Wilk, sergey.dyasli

On 08/02/2023 6:04 pm, Ross Lagerwall wrote:
> 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@citrix.com>

Acked-by: Andrew Cooper <andrew.cooper3@citrix.com>


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-02-15 13:52 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-02-08 18:04 [PATCH] create-diff-object: Handle missing secsym for debug sections Ross Lagerwall
2023-02-09  8:46 ` Jan Beulich
2023-02-13 17:36   ` Ross Lagerwall
2023-02-15 13:51 ` Andrew Cooper

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.