[PATCH] ld: add --package-metadata

Jose E. Marchesi jose.marchesi@oracle.com
Tue May 24 09:34:05 GMT 2022


Hi Luca.

>> I've added an optional usage of libjansson to provide additional validation,
>> so that it doesn't have to be reimplemented everywhere a thousand
>> times over.
>> For bootstrapping purposes the dep is optional and can be skipped, for example
>> in Debian/Ubuntu it would be annotated with <!stage1> so that everything
>> works out of the box.

As far as I can see at https://systemd.io/COREDUMP_PACKAGE_METADATA/ the
payload encoded in JSON comprises a single object which must be a
dictionary, whose entries all contain strings.  Basically:

  {"..." : "..."[, "..." : "..."]*}

Isn't it a bit overkill to add a dependency to an external library just
to verify the format of the above?  A regular expression would suffice,
even if a fastidious one due to the string format:

  S -> JSON string
  B -> [\n\t ]*

  PAYLOAD -> B{BSB:BSB(,SB:BSB)*}B

>>
>>  bfd/elf-bfd.h                        |   8 ++
>>  bfd/elf.c                            |   6 +-
>>  ld/Makefile.am                       |   6 +-
>>  ld/configure.ac                      |  35 ++++++++
>>  ld/emultempl/elf.em                  |   9 ++
>>  ld/ld.texi                           |   7 ++
>>  ld/ldelf.c                           | 121 ++++++++++++++++++++++++++-
>>  ld/ldelf.h                           |   2 +
>>  ld/lexsup.c                          |   2 +
>>  ld/testsuite/ld-elf/package-note.exp |  49 +++++++++++
>>  ld/testsuite/ld-elf/package-note.rd  |   6 ++
>>  11 files changed, 244 insertions(+), 7 deletions(-)
>>  create mode 100644 ld/testsuite/ld-elf/package-note.exp
>>  create mode 100644 ld/testsuite/ld-elf/package-note.rd
>
> Hi Nick,
>
> Did you have any chance to look at this? Any thoughts? Thanks!
>
> Kind regards,
> Luca Boccassi


More information about the Binutils mailing list