[PATCH 2/2] z80-elf: support complex relocation symbols

H. Peter Anvin hpa@zytor.com
Mon Oct 13 20:25:58 GMT 2025


Some Z80 code, like the z88dk libc, does rely on being able to do
computation between external symbols.

Enable complex relocation support (expression symbols) on Z80.

[ Is there any fundamental reason not to do this globally? ]

Signed-off-by: H. Peter Anvin <hpa@zytor.com>
---
 gas/config/tc-z80.h | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/gas/config/tc-z80.h b/gas/config/tc-z80.h
index 50e09124ad60..f181a2c9eb34 100644
--- a/gas/config/tc-z80.h
+++ b/gas/config/tc-z80.h
@@ -30,6 +30,11 @@
 #define BFD_ARCH      TARGET_ARCH
 #define TARGET_BYTES_BIG_ENDIAN  0
 
+/* Support computed relocations.  */
+#ifdef OBJ_ELF
+# define OBJ_COMPLEX_RELC
+#endif
+
 /* If you define this macro, GAS will warn about the
    use of nonstandard escape sequences in a string.  */
 #define ONLY_STANDARD_ESCAPES
-- 
2.51.0



More information about the Binutils mailing list