Joachim Strömbergson joachim@secworks.se writes:
I just tested a clean clone and it fails on the gcm-hash8.s due do the final section is being set to .rodata in the asm file. I changed it to __TEXT,__const and then it builds. Patch below.
Good progress.
Below is an untested patch for the configure machinery. Can you try this?
BTW, is ".section __TEXT,__const" different from the text segment used for the executable code? Or would it work just sas well to have an definition of RODATA, and get the table in the same section as the code?
Regards, /Niels
diff --git a/config.m4.in b/config.m4.in index 4c6565f..da57e25 100644 --- a/config.m4.in +++ b/config.m4.in @@ -6,6 +6,7 @@ define(<TYPE_PROGBITS>, <@ASM_TYPE_PROGBITS@>)dnl define(<ALIGN_LOG>, <@ASM_ALIGN_LOG@>)dnl define(<ALIGNOF_UINT64_T>, <@ALIGNOF_UINT64_T@>)dnl define(<W64_ABI>, <@W64_ABI@>)dnl +define(<RODATA>, <@ASM_RODATA@>)dnl divert(1) @ASM_MARK_NOEXEC_STACK@ divert diff --git a/configure.ac b/configure.ac index a4deaae..acfc59c 100644 --- a/configure.ac +++ b/configure.ac @@ -332,10 +332,19 @@ EOF AC_MSG_WARN([No assembler files found.]) fi fi + case "$host_os" in + darwin*) + ASM_RODATA='.section __TEXT,__const' + ;; + *) + ASM_RODATA='.section .rodata' + ;; + esac fi
AC_SUBST([OPT_ASM_NETTLE_SOURCES]) AC_SUBST([OPT_ASM_HOGWEED_SOURCES]) +AC_SUBST([ASM_RODATA])
AH_VERBATIM([HAVE_NATIVE], [/* Define to 1 each of the following for which a native (ie. CPU specific) diff --git a/x86_64/gcm-hash8.asm b/x86_64/gcm-hash8.asm index 60f444d..e742cec 100644 --- a/x86_64/gcm-hash8.asm +++ b/x86_64/gcm-hash8.asm @@ -188,7 +188,7 @@ ALIGN(16) EPILOGUE(_nettle_gcm_hash8)
define(<W>, <0x$2$1>) - .section .rodata + RODATA ALIGN(2) .Lshift_table: .short W(00,00),W(01,c2),W(03,84),W(02,46),W(07,08),W(06,ca),W(04,8c),W(05,4e)