elflint: fix undefined 'buffer_left' reference
authorSergei Trofimovich <slyfox@gentoo.org>
Mon, 7 Jun 2021 21:37:42 +0000 (22:37 +0100)
committerDmitry V. Levin <ldv@altlinux.org>
Mon, 7 Jun 2021 22:02:41 +0000 (22:02 +0000)
commitc6e1f664254a8ae16e2e6d726c5159ecb7f27d3b
tree9121b35a2e3442dd560094024bcd82f3761adb39
parent01747645a490fbe6e120657592954e0e84b4ba69
elflint: fix undefined 'buffer_left' reference

Link failure is reproducible on gcc-11.1.0 target:

```
$ autoreconf -i -f
$ ./configure --enable-maintainer-mode --disable-debuginfod \
    --host=x86_64-pc-linux-gnu \
    CFLAGS=-march=znver3 \
    CXXFLAGS=-march=znver3 \
    LDFLAGS=" "
$ make

  CCLD     elflint
ld: elflint.o: in function `check_attributes':
elflint.c:(.text+0xdcff): undefined reference to `buffer_left'
ld: elflint.c:(.text+0xe557): undefined reference to `buffer_left'
```

It happens due to possible external linkage of `buffer_left()`.

The change forces local linkage to always use local definition
(either inline or out-of-line).

Reported-by: Toralf Förster
Bug: https://bugs.gentoo.org/794601
Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org>
Fixes: e95d1fbb ("elflint: Pull left() in file scope")
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
src/ChangeLog
src/elflint.c