Skip to content

Instantly share code, notes, and snippets.

@ivan-aksamentov
Created October 3, 2018 12:36
Show Gist options
  • Save ivan-aksamentov/71e6d01abf78d569f698502c4e69e249 to your computer and use it in GitHub Desktop.
Save ivan-aksamentov/71e6d01abf78d569f698502c4e69e249 to your computer and use it in GitHub Desktop.
Patch for binutils 2.31.1 that fixes "invalid version 21 (max 0)" errors https://sourceware.org/ml/binutils/2018-08/msg00227.html
@ivan-aksamentov
Copy link
Author

ivan-aksamentov commented Oct 3, 2018

What is this

This patch fixes an issue with symbol versioning when using binutils 2.31.1.
In particular, when you try to link binary artifacts created using binutils 2.30+ together with artifacts created using previous versions of binutils, you may get linker errors similar to:

/usr/bin/ld: bin/libKF5Service.so.5.49.0: _edata: invalid version 21 (max 0)
/usr/bin/ld: bin/libKF5Service.so.5.49.0: error adding symbols: bad value

Check if there is a version newer than 2.31.1 released and whether this fix is already incorporated in it (it was not the case on the moment of creating this gist).

Links:

Howto:

cd binutils-2.31.1/

# Get this patch
git clone https://gist.github.com/71e6d01abf78d569f698502c4e69e249

# See what it modifies
git apply --stat 71e6d01abf78d569f698502c4e69e249/binutils-bfd-elflink.patch

# Check for errors
git apply --check 71e6d01abf78d569f698502c4e69e249/binutils-bfd-elflink.patch

# Apply
git apply 71e6d01abf78d569f698502c4e69e249/binutils-bfd-elflink.patch

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment