Duff's device, as emitted by GCC[0], is a bit on the verbose side but still quite neat. In particular the single-instruction computed goto that uses a look-up table made up of 8 quad-words, filled in by the linker.
Note the '.section .rodata' directive which actually places the quads pointers, seemingly interleaved with code, in a read-only data section.
Note also the dec/test/jle instructions implementing the while loop occur before the last of the eight copy operations, and interleaved with the next-to-last copy operation.
> Note the '.section .rodata' directive which places ..., seemingly interleaved with code, in a read-only data section.
It only specifies which section that part of "code" goes into, the linker pools it all up in a binary image and fills in the address for the tags when linking as directed by the linker script[0].
Note the '.section .rodata' directive which actually places the quads pointers, seemingly interleaved with code, in a read-only data section.
Note also the dec/test/jle instructions implementing the while loop occur before the last of the eight copy operations, and interleaved with the next-to-last copy operation.
___edit: formatting, sigh
[0] v 7.3.0 64bit; gcc -S -Os -masm=intel