1
0
mirror of https://gitlab.com/libvirt/libvirt.git synced 2024-12-22 17:34:18 +03:00

scripts: Make check-symfile.py work on alpha

The script expects each of the symbols that it looks for to
be in one of three sections, which in nm(1) are described as
follows:

  T - The symbol is in the text (code) section.
  B - The symbol is in the BSS data section. This section
      typically contains zero-initialized or uninitialized
      data, although the exact behavior is system dependent.
  D - The symbol is in the initialized data section.

When building on alpha, however, some of the symbols show up
in one of two additional sections, specifically:

  S - The symbol is in an uninitialized or zero-initialized
      data section for small objects.
  G - The symbol is in an initialized data section for small
      objects.

In other words, S is the same as B and G is the same as D,
except with some optimization for small objects that for some
reason is applied on alpha but not on other architectures.

I have confirmed that, for all the symbols that the script
complained about being missing on alpha, the section is the
expected one, that is, symbols that are reported as B on x86
are reported as S on alpha, and symbols that are reported as
D on x86 are reported as G on alpha.

Note that, while the B section doesn't seem to be used at all
on alpha, at least in our case, the D section still is.

Signed-off-by: Andrea Bolognani <abologna@redhat.com>
Reviewed-by: Michal Privoznik <mprivozn@redhat.com>
This commit is contained in:
Andrea Bolognani 2024-01-20 18:20:21 +01:00
parent 189fdeff10
commit 2757e91c2b

View File

@ -61,7 +61,7 @@ for elflib in elflibs:
for line in nm:
line = line.decode("utf-8")
symmatch = re.search(r'''^\S+\s(?:[TBD])\s(\S+)\s*$''', line)
symmatch = re.search(r'''^\S+\s(?:[TBSDG])\s(\S+)\s*$''', line)
if symmatch is None:
continue