> > From: Frediano Ziglio 
> > Sent: Thursday, September 18, 2025 10:51 AM
> > To: xen-devel@xxxxxxxxxxxxxxxxxxxx 
> > Cc: Frediano Ziglio ; Ross Lagerwall ; Konrad Rzeszutek Wilk ; Andrew 
> > Cooper ; Roger Pau Monne 
> > Subject: [PATCH livepatch-build-tools] Treat constant sections as string 
> > sections
> >  
> > Newer compiler can put some constant strings inside constant
> > sections (.rodata.cstXX) instead of string sections (.rodata.str1.XX).
> > This causes the produced live patch to not apply when such
> > strings are produced.
> > So treat the constant sections as string ones.
> 
> 
> Are you sure it was a string and not something else? As far as I can
> tell GCC chooses the section in categorize_decl_for_section() which
> doesn't appear to ever put constant strings in .rodata.cst.
>


In the specific case it was a "h" string (used for continuation).
 
> 
> In any case if we have a reference to a constant in .rodata.cst then the
> section _does_ need to be included in its entirety, though it makes me
> wonder if is_rodata_str_section is the best place for this check.
> 
> 
> > 
> > Signed-off-by: Frediano Ziglio 
> > ---
> >  create-diff-object.c | 6 ++++++
> >  1 file changed, 6 insertions(+)
> > 
> > diff --git a/create-diff-object.c b/create-diff-object.c
> > index 7e6138b..7acaf88 100644
> > --- a/create-diff-object.c
> > +++ b/create-diff-object.c
> > @@ -1446,11 +1446,16 @@ static bool is_rodata_str_section(const char *name)
> 
> 
> Can you update the comment at the top of this function?
> 

I'll do it.

> 
> >  {
> >  #define GCC_5_SECTION_NAME ".rodata.str1."
> >  #define GCC_6_SECTION_NAME ".str1."
> > +#define GCC_CSTR ".rodata.cst"
> 
> 
> What does CSTR stand for? May call it GCC_CONSTANT_SECTION_NAME instead?
> 

It makes sense, I'll change it.

> 
> Ross

Frediano

Reply via email to