The assembler erroneously converted the special register names "ap" and
"cc" to the DWARF register numbers 32 and 33 respectively, which are
actually assigned to the control registers c0 and c1 according to both
the s390 32-bit (s390) ELF ABI [1] and s390 64-bit (s390x) ELF ABI [2].
Register numbers 32 and 33 are used internally by GCC as "argument
pointer" (ap) and "condition code" (cc). Very early GCC versions leaked
this out into DWARF. However, those GCC-internal special register names
should never be actually used in CFI, especially given their resulting
DWARF register numbers have a different meaning in DWARF (CFI).
[1]: s390 ELF ABI, section "DWARF definition",
https://refspecs.linuxbase.org/ELF/zSeries/lzsabi0_s390.html
[2]: s390x ELF ABI, subsection "DWARF Register Numbers",
https://github.com/IBM/s390x-abi/releases
gas/
* config/tc-s390.c (tc_s390_regname_to_dw2regnum): Remove
support for register names "ap" and "cc" in CFI directives.
Suggested-by: Ulrich Weigand <ulrich.weigand@de.ibm.com>
Signed-off-by: Jens Remus <jremus@linux.ibm.com>
regnum += 48;
}
}
- else if (strcmp (regname, "ap") == 0)
- regnum = 32;
- else if (strcmp (regname, "cc") == 0)
- regnum = 33;
return regnum;
}