Created
October 3, 2018 12:36
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/bfd/elflink.c | |
+++ b/bfd/elflink.c | |
@@ -686,13 +686,11 @@ bfd_elf_record_link_assignment (bfd *output_bfd, | |
&& !h->def_regular) | |
h->root.type = bfd_link_hash_undefined; | |
- /* If this symbol is not being provided by the linker script, and it is | |
- currently defined by a dynamic object, but not by a regular object, | |
- then clear out any version information because the symbol will not be | |
- associated with the dynamic object any more. */ | |
- if (!provide | |
- && h->def_dynamic | |
- && !h->def_regular) | |
+ /* If this symbol is currently defined by a dynamic object, but not | |
+ by a regular object, then clear out any version information because | |
+ the symbol will not be associated with the dynamic object any | |
+ more. */ | |
+ if (h->def_dynamic && !h->def_regular) | |
h->verinfo.verdef = NULL; | |
/* Make sure this symbol is not garbage collected. */ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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:
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: