[openssl/openssl] fc807a: extend x86_64-xlate.pl perlasm so it can handle .r...

Theo Buehler noreply at github.com
Wed Apr 17 07:41:06 UTC 2024


  Branch: refs/heads/master
  Home:   https://github.com/openssl/openssl
  Commit: fc807a0349bbddb00273465097177025d9b4e25e
      https://github.com/openssl/openssl/commit/fc807a0349bbddb00273465097177025d9b4e25e
  Author: Alexandr Nedvedicky <sashan at openssl.org>
  Date:   2024-04-17 (Wed, 17 Apr 2024)

  Changed paths:
    M crypto/perlasm/x86_64-xlate.pl

  Log Message:
  -----------
  extend x86_64-xlate.pl perlasm so it can handle .rodata sections properly

For nasm/masm assembler flavors the xlate script must make sure the code
won't land in .rodata section along the data.

For masm we also need to introduce an .align option which can be passed
along section header. It's hint for masm to align rodata/rdata section
properly.

Also macos-x flavor requires small tweak to emit proper section header
for its assembler style.

Changes for masm flavor are based on SEGMENT description [1] in
MASM reference manual.

Changes for nasm flavor are based on nasm 2.14 manual chapter 7 [2].

Details behind macos-x changes can be found in 'Overview of the Mach-O
Executable Format' [3]

[1] https://learn.microsoft.com/en-us/cpp/assembler/masm/segment?view=msvc-170

[2] https://nasm.us/xdoc/2.14rc0/html/nasmdoc7.html

[3] https://developer.apple.com/library/archive/documentation/Performance/Conceptual/CodeFootprint/Articles/MachOOverview.html

Reviewed-by: Richard Levitte <levitte at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23997)


  Commit: 25391acc140e215774242bf3b0a51d59754a23f4
      https://github.com/openssl/openssl/commit/25391acc140e215774242bf3b0a51d59754a23f4
  Author: Theo Buehler <tb at openbsd.org>
  Date:   2024-04-17 (Wed, 17 Apr 2024)

  Changed paths:
    M crypto/aes/asm/aes-x86_64.pl
    M crypto/aes/asm/aesni-sha1-x86_64.pl
    M crypto/aes/asm/aesni-sha256-x86_64.pl
    M crypto/aes/asm/aesni-x86_64.pl
    M crypto/aes/asm/bsaes-x86_64.pl
    M crypto/aes/asm/vpaes-x86_64.pl
    M crypto/bn/asm/rsaz-x86_64.pl
    M crypto/bn/asm/x86_64-mont5.pl
    M crypto/camellia/asm/cmll-x86_64.pl
    M crypto/chacha/asm/chacha-x86_64.pl
    M crypto/ec/asm/ecp_nistz256-x86_64.pl
    M crypto/modes/asm/aesni-gcm-x86_64.pl
    M crypto/modes/asm/ghash-x86_64.pl
    M crypto/poly1305/asm/poly1305-x86_64.pl
    M crypto/sha/asm/keccak1600-x86_64.pl
    M crypto/sha/asm/sha1-mb-x86_64.pl
    M crypto/sha/asm/sha1-x86_64.pl
    M crypto/sha/asm/sha256-mb-x86_64.pl
    M crypto/sha/asm/sha512-x86_64.pl
    M crypto/whrlpool/asm/wp-x86_64.pl

  Log Message:
  -----------
  Unable to run asm code on OpenBSD (amd64)

In order to get asm code running on OpenBSD we must place
all constants into .rodata sections.

davidben@ also pointed out we need to adjust `x86_64-xlate.pl` perlasm
script to adjust read-olny sections for various flavors (OSes). Those
changes were cherry-picked from boringssl.

closes #23312

Reviewed-by: Richard Levitte <levitte at openssl.org>
Reviewed-by: Tomas Mraz <tomas at openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23997)


Compare: https://github.com/openssl/openssl/compare/8d8a01443033...25391acc140e

To unsubscribe from these emails, change your notification settings at https://github.com/openssl/openssl/settings/notifications


More information about the openssl-commits mailing list