Re: [dpdk-dev] [PATCH] pmdinfogen: allow padding after NUL terminator
From: David Marchand <hidden>
Date: 2021-05-27 06:53:37
From: David Marchand <hidden>
Date: 2021-05-27 06:53:37
On Wed, May 26, 2021 at 11:44 PM Dmitry Kozlyuk [off-list ref] wrote:
Size of string constant symbol may be larger than its length
measured up to NUL terminator. In this case pmdinfogen included padding
bytes after NUL terminator in generated source, yielding incorrect code.
Always trim string data to NUL terminator while reading ELF.
It was already done for COFF because there's no symbol size.
Bugzilla ID: 720
Fixes: f0f93a7adfee ("buildtools: use Python pmdinfogen")
Signed-off-by: Dmitry Kozlyuk <redacted>Reproduced the issue described in bz on my (old) RHEL7 with clang 3.4.2. Reviewed-by: David Marchand <redacted> Just to confirm my reading of the C version of pmdinfogen: the C version formats those symbols fine with printf %s. So there should be no need for a fix in stable branches, right? -- David Marchand