MINOR: version: make the version strings variables, not constants
authorWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2019 07:44:55 +0000 (09:44 +0200)
committerWilly Tarreau <w@1wt.eu>
Wed, 16 Oct 2019 07:56:57 +0000 (09:56 +0200)
commitabefa34c344b7aa2c38654664c2dd170d50e3b2e
tree0110d46190c50a76ad8e0ca0cd9c25d756193d8b
parente0f48ae976cb4774537ce46a1fa35d8cdbc64928
MINOR: version: make the version strings variables, not constants

It currently is not possible to figure the exact haproxy version from a
core file for the sole reason that the version is stored into a const
string and as such ends up in the .text section that is not part of a
core file. By turning them into variables we move them to the data
section and they appear in core files. In order to help finding them,
we just prepend an extra variable in front of them and we're able to
immediately spot the version strings from a core file:

  $ strings core | fgrep -A2 'HAProxy version'
  HAProxy version follows
  2.1-dev2-e0f48a-88
  2019/10/15

(These are haproxy_version and haproxy_date respectively). This may be
backported to 2.0 since this part is not support to impact anything but
the developer's time spent debugging.
include/common/version.h
src/version.c