bug-binutils
[Top][All Lists]
Advanced

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

[Bug ld/32003] Specifying --package-metadata might not be possible and i


From: bdrung at posteo dot de
Subject: [Bug ld/32003] Specifying --package-metadata might not be possible and is too fragile
Date: Fri, 09 Aug 2024 20:26:20 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=32003

--- Comment #23 from Benjamin Drung <bdrung at posteo dot de> ---
(In reply to H.J. Lu from comment #14)
> (In reply to Benjamin Drung from comment #13)
> 
> > > Will "%[string]" escape work?
> > 
> > Like this?
> > 
> > -Wl,--encoded-package-metadata={%[quot]type%[quot]:
> > %[quot]deb%[quot]%[comma]%[quot]os%[quot]:
> > %[quot]ubuntu%[quot]%[comma]%[quot]name%[quot]:
> > %[quot]dpkg%[quot]%[comma]%[quot]version%[quot]:%[quot]1.22.
> > 6ubuntu15%[quot]%[comma]%[quot]architecture%[quot]:%[quot]amd64%[quot]}
> 
> It should be %[quote]".

You suggested to borrow from HTML's Named Character References and
https://dev.w3.org/html5/spec-LC/named-character-references.html says that
U+00022 has the name "quot" (not "quote").

> Will adding support for "%[string]" to existing
> --package-metadata option break anything?

It might theoretical break existing use cases. 

--package-metadata='{"version":"1.0%2"}'

The only safe option that I could come up with is to use a marker that would be
invalid JSON. For example: If the string starts with a percent character,
decode it:

--package-metadata='%{"foo":"bar"%[comma]"baz":42}'

would be invalid JSON and decode to:

--package-metadata='{"foo":"bar","baz":42}'

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]