Summary: | pushq/popq %gs/%fs in .code64 now unsupported | ||
---|---|---|---|
Product: | binutils | Reporter: | Christian Ehrhardt <christian.ehrhardt> |
Component: | gas | Assignee: | Not yet assigned to anyone <unassigned> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | jbeulich |
Priority: | P2 | ||
Version: | 2.33 | ||
Target Milestone: | 2.34 | ||
Host: | Target: | ||
Build: | Last reconfirmed: | 2019-09-18 00:00:00 |
Description
Christian Ehrhardt
2019-09-18 15:30:24 UTC
It is caused by commit 21df382b918888de64749e977f185c4e10a5b838 Author: Jan Beulich <jbeulich@suse.com> Date: Tue Jul 16 09:30:29 2019 +0200 x86: fold SReg{2,3} They're the only exception to there generally being no mix of register kinds possible in an insn operand template, and there being two bits per operand for their representation is also quite wasteful, considering the low number of uses. Fold both bits and deal with the little bit of fallout. Also take the liberty and drop dead code trying to set REX_B: No segment register has RegRex set on it. Additionally I was quite surprised that PUSH/POP with the permitted segment registers is not covered by the test cases. Add the missing pieces. Assembler disallows "popq %fs", but disassembler still display "popq %fs". Thanks H.J. Lu, so the change was intentional just as I thought. I'll add this to the thread [1] I have with the ipxe people then. If there is anyone here that wants to help guiding [1] please feel free to chime in there or let me know here and I can pass the info. [1]: http://lists.ipxe.org/pipermail/ipxe-devel/2019-September/006763.html Hmm, yes - No_qSuf gets in the way here. Simply removing the attribute won't work though, I'm afraid. I'll try to find time soon to look into this. (And I'm surprised there's nothing in the testsuite that would have allowed me to notice this before even submitting the patch.) Fixed for 2.34 by commit 3f9aad111cea2f25877d0a6b404956769c14faee Author: Jan Beulich <jbeulich@suse.com> Date: Fri Sep 20 10:18:15 2019 +0200 x86-64: fix handling of PUSH/POP of segment register Commit 21df382b91 ("x86: fold SReg{2,3}") went too far: Folding 64-bit PUSH/POP templates into non-64-bit ones isn't correct, due to the different operand widths, and hence suffixes permitted. Restore the separate templates. Add tests of PUSH/POP with q suffix and %fs/%gs operands to the testsuite. While doing so also add PUSHF/POPF ones _without_ suffix. and on 2.33 branch by commit 20057c8c5e67ffdfb1a7b6a4ef3d337ea27663d1 Author: Jan Beulich <jbeulich@suse.com> Date: Fri Sep 20 10:18:15 2019 +0200 x86-64: fix handling of PUSH/POP of segment register Commit 21df382b91 ("x86: fold SReg{2,3}") went too far: Folding 64-bit PUSH/POP templates into non-64-bit ones isn't correct, due to the different operand widths, and hence suffixes permitted. Restore the separate templates. Add tests of PUSH/POP with q suffix and %fs/%gs operands to the testsuite. While doing so also add PUSHF/POPF ones _without_ suffix. (cherry picked from commit 3f9aad111cea2f25877d0a6b404956769c14faee) Thank you Jan! |