[PATCH 0/3] Algol68 modules changes for Mach-O.
Jose E. Marchesi
jemarch@gnu.org
Tue Nov 25 21:47:44 GMT 2025
Hello Iain.
Thank you for the Darwin fixes.
OK for the series.
> The object format used on macOS/Darwin is called Mach-O. This has
> different assembler syntax, binary layout and section constraints
> from ELF.
>
> Mach-O named sections are grouped into segments (typically ones
> for __TEXT, __DATA, __DWARF etc. For GNU we add other groups such
> as __GNU_LTO. For Algol68 modules we are adding __GNU_A68. When
> a section name is specified, we also have to specify the segment
> it belongs in. So that the Mach-O section syntax has a name of the
> form "segment_name,section_name". It is also convention to start
> segments and sections with __ (although alternatives will work).
> The first patch handles this.
>
> The Mach-O static linker processes objects in terms of 'atoms'
> which are portions of an object split at linker-visible symbols.
> Linker-visible symbols are the set of all global ones and all
> local ones that do not start with "L". This means that if we want
> the assembler to process local symbol subtractions to produce an
> assemble-time constant, those symbols must start with 'L' otherwise
> the assembler will emit relocations implementing the subtraction.
> The second patch handles this.
>
> Finally, the simple-object implementation for Mach-O has primarily
> been used for LTO and needs a small update to allow it to be used
> for non-LTO sections.
> This is the third patch.
>
> Tested on x86_64-darwin24, x86_64-darwin23, x86_64-darwin17,
> i686_darwin17, powerpc64le-linux, x86_64-linux (32b multilib).
>
> OK?
> Iain
>
> ---
>
> Iain Sandoe (3):
> a68, Darwin: Handle Mach-O section name syntax.
> a68, Darwin: Make sure to use assembler-local labels.
> libiberty, Darwin: Amend section processing for non-LTO use.
>
> gcc/algol68/a68-exports.cc | 22 ++++++++++++++--------
> gcc/config/darwin.h | 4 ++++
> libiberty/simple-object-mach-o.c | 24 +++++++-----------------
> 3 files changed, 25 insertions(+), 25 deletions(-)
More information about the Algol68
mailing list