zfs: Use .section .rodata instead of .rodata on FreeBSD

In commit 0a5b942d4 the FreeBSD SECTION_STATIC macro was set to
".rodata". This assembler directive is supported by LLVM (as a
convenience alias for ".section .rodata") by not by GNU as.

This caused the FreeBSD builds that are done with gcc to fail.
Therefore, use ".section .rodata" instead, similar to the other
asm_linkage.h headers.

[mjg: cherry-picked from upstream zfs bf1bec394e
 to unbreak gcc12 build]

Reviewed-by: Mateusz Guzik <mjguzik@gmail.com>
Reviewed-by: Attila Fülöp <attila@fueloep.org>
Reviewed-by: Jorgen Lundman <lundman@lundman.net>
Signed-off-by: Dimitry Andric <dimitry@andric.com>
Closes #14526
This commit is contained in:
Dimitry Andric 2023-02-25 01:45:48 +01:00 committed by Mateusz Guzik
parent 0a310c94ee
commit 84f06098ef
2 changed files with 2 additions and 2 deletions

View File

@ -36,7 +36,7 @@
#define ENDBR
#define SECTION_TEXT .text
#define SECTION_STATIC .rodata
#define SECTION_STATIC .section .rodata
#ifdef __cplusplus
extern "C" {

View File

@ -40,7 +40,7 @@
#define ENDBR
#define SECTION_TEXT .text
#define SECTION_STATIC .rodata
#define SECTION_STATIC .section .rodata
#ifdef __cplusplus
extern "C" {