From 1227db3dbe713cc3b109655e9bd6e5cca84ea01b Mon Sep 17 00:00:00 2001 From: Dave MacLachlan Date: Tue, 11 Jun 2024 15:52:08 -0700 Subject: [PATCH] Fix UPB_LINKARR_DECLARE section name The section name was missing a double underscore, which is the convention. https://github.com/aidansteele/osx-abi-macho-file-format-reference#:~:text=Segments%20and%20sections%20are,tools%20to%20operate%20correctly. PiperOrigin-RevId: 642420355 --- upb/port/def.inc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/upb/port/def.inc b/upb/port/def.inc index fe94b920aa..19ac51f127 100644 --- a/upb/port/def.inc +++ b/upb/port/def.inc @@ -390,13 +390,13 @@ error UPB_TRACING_ENABLED Tracing should be disabled in production builds /* As described in: https://stackoverflow.com/a/22366882 */ #define UPB_LINKARR_APPEND(name) \ - __attribute__((retain, used, section("__DATA,la_" #name))) + __attribute__((retain, used, section("__DATA,__la_" #name))) #define UPB_LINKARR_DECLARE(name, type) \ extern type const __start_linkarr_##name __asm( \ - "section$start$__DATA$la_" #name); \ + "section$start$__DATA$__la_" #name); \ extern type const __stop_linkarr_##name __asm( \ "section$end$__DATA$" \ - "la_" #name); \ + "__la_" #name); \ UPB_LINKARR_APPEND(name) type UPB_linkarr_internal_empty_##name[1] #define UPB_LINKARR_START(name) (&__start_linkarr_##name) #define UPB_LINKARR_STOP(name) (&__stop_linkarr_##name)