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: f0f93a7adf ("buildtools: use Python pmdinfogen")
Cc: stable@dpdk.org
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
clang archiver tool is llvm-ar on Windows and ar on other platforms.
MinGW always uses ar. Replace shell script (Unix-only) that calls ar
with a Python script (OS-independent) that calls an appropriate archiver
tool selected at configuration time. Move the logic not to generate
empty sources into pmdinfogen.
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Common Object File Format (COFF) is used on Windows in place of ELF.
Add COFF parser to pmdinfogen. Also add an argument to specify input
file format, which is selected at configure time based on the target.
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Using a high-level, interpreted language simplifies maintenance and
build process. Furthermore, ELF handling is delegated to pyelftools
package. Original logic is kept, the copyright recognizes that.
Signed-off-by: Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Acked-by: Neil Horman <nhorman@tuxdriver.com>
Tested-by: Jie Zhou <jizh@microsoft.com>