Timeline for Calling printf in x86_64 using GNU assembler
Current License: CC BY-SA 4.0
22 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 13, 2021 at 4:53 | history | edited | technomage | CC BY-SA 4.0 |
Fix column reference
|
Jul 18, 2018 at 22:50 | history | edited | Michael Petch | CC BY-SA 4.0 |
Add information on calling through the PLT
|
Jul 18, 2018 at 22:39 | history | edited | Michael Petch | CC BY-SA 4.0 |
Cleanup, add section on possible relocation error.
|
Jul 18, 2018 at 22:34 | history | edited | Michael Petch | CC BY-SA 4.0 |
Cleanup, add section on possible relocation error.
|
Jun 11, 2018 at 18:31 | history | edited | Michael Petch | CC BY-SA 4.0 |
added 7 characters in body
|
Jun 11, 2018 at 18:13 | history | edited | Michael Petch | CC BY-SA 4.0 |
added 43 characters in body
|
Jun 11, 2018 at 18:06 | comment | added | Peter Cordes |
The changelog message from my edit contains the important points. . The ABI doc link is broken. The other changes are optional, because xor %eax,%eax is the best way to set AL or RAX to zero (so it's not harmful to say that variadic functions look at %rax instead of %al ), and the rest were just extra details / comments I made since an edit was needed anyway to fix the ABI link.
|
|
Jun 11, 2018 at 17:55 | history | rollback | Michael Petch |
Rollback to Revision 7
|
|
Jun 11, 2018 at 17:42 | history | edited | Peter Cordes | CC BY-SA 4.0 |
update ABI link. It was always %al, not %rax, and the updated ABI corrects the wording in that place to match the rest of the doc. `mov $format, %rdi` didn't use movabs so it won't use an imm64, so it only works in non-PIE executables. Make it explicit with %edi
|
Mar 13, 2017 at 18:57 | comment | added | Nick Desaulniers | Excellent recommendations. Future travelers, see also: nickdesaulniers.github.io/blog/2014/04/18/… | |
Jul 29, 2016 at 20:37 | audit | First posts | |||
Jul 29, 2016 at 21:22 | |||||
Jul 26, 2016 at 15:59 | audit | First posts | |||
Jul 26, 2016 at 15:59 | |||||
Jul 14, 2016 at 18:18 | history | edited | Michael Petch | CC BY-SA 3.0 |
Fix typo
|
Jul 12, 2016 at 21:17 | history | edited | Michael Petch | CC BY-SA 3.0 |
Fix rodata section error.
|
Jul 12, 2016 at 18:53 | comment | added | Michael Petch |
In this particular code example since there is only one call and it appears at the end one can JMP to printf rather than CALL and eliminate the stack alignment with the PUSH/POP. That was outside the scope of my answer but one can always look at literature on TAIL CALL optimizations
|
|
Jul 12, 2016 at 18:51 | comment | added | L's World | I have reorganized my code and it works. I thought it was a problem of import printf, which is not necessary. Thanks so much. | |
Jul 12, 2016 at 18:47 | vote | accept | L's World | ||
Jul 12, 2016 at 18:38 | history | edited | Michael Petch | CC BY-SA 3.0 |
Make ANY clearer regarding choice of register to push to align.
|
Jul 12, 2016 at 18:27 | history | edited | Michael Petch | CC BY-SA 3.0 |
Fix formatting, add additional suggestions
|
Jul 12, 2016 at 18:12 | history | edited | Michael Petch | CC BY-SA 3.0 |
Inline some quotes from the ABI
|
Jul 12, 2016 at 18:05 | history | edited | Michael Petch | CC BY-SA 3.0 |
Inline some quotes from the ABI
|
Jul 12, 2016 at 17:45 | history | answered | Michael Petch | CC BY-SA 3.0 |