Found during exp-run for PR 198611 [1], reported in ELF tool chain ticket 485 [2]. It looks like the root cause is a NASM bug.
I'm not sure about the correct way to handle this case, but an assertion failure from libelf is probably not it. We can try to correct the alignment (as in this change), or refuse to accept the input file.
section_type_alignment is derived from _libelf_falign and _libelf_xlate_shtype. We could consider adding these as extensions to the libelf interface, but it doesn't seem worthwhile when the duplication is relatively small.
[1] https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=198611
[2] https://sourceforge.net/p/elftoolchain/tickets/485/