Add symbol sizes to .symbols files

If we change a symbol size (e.g. array) in a .c file that is a part of
.so, executables that use it are not re-linked resulting in a runtime
error:

"Symbol xyz has different size in shared object, consider re-linking"

Adding symbol sizes to .symbol files fixes this issue.
pull/5220/head
Arkadiusz Hiler 6 years ago committed by Jussi Pakkanen
parent 94ba53c6b6
commit 690dd723f4
  1. 9
      mesonbuild/scripts/symbolextractor.py

@ -68,7 +68,14 @@ def linux_syms(libfilename, outfilename):
libfilename])[0:2]
if pnm.returncode != 0:
raise RuntimeError('nm does not work.')
result += [' '.join(x.split()[0:2]) for x in output.split('\n') if len(x) > 0]
for line in output.split('\n'):
if len(line) == 0:
continue
line_split = line.split()
entry = line_split[0:2]
if len(line_split) >= 4:
entry += [line_split[3]]
result += [' '.join(entry)]
write_if_changed('\n'.join(result) + '\n', outfilename)
def osx_syms(libfilename, outfilename):

Loading…
Cancel
Save