On Mon, Jun 8, 2026, at 9:59 AM, Iain Sandoe wrote: >> On 8 Jun 2026, at 14:53, Jose E. Marchesi <[email protected]> wrote: >> >>>> >>>> On 8 Jun 2026, at 14:09, Pietro Monteiro <[email protected]> wrote: >>>> >>>> Mach-O objects prefix section names with double underscore instead of >>>> period. Use correct exports section name on systems that use Mach-O. >>>> >>>> gcc/algol68/ChangeLog: >>>> >>>> * a68.h (A68_EXPORT_SECTION_NAME): Prefix name with double >>>> underscores for Mach-O objects. >>> >>> I am a bit puzzled by this - since I had memory that we (Jose and I) had >>> already >>> fixed things so that Darwin’s segment and section names were correct. >>> (indeed, AFAIK a68 exports in object files and convenience libraries are >>> already >>> working)? >> >> I am also a bit confused. From our past testing, it looked like in >> Darwin it was ok to create a section .a68_exports and then read it in, >> conventions notwithstanding. > > That is my expectation - that, at the binary level, all that matters is that > the > segment and section names are <= 16 chars in length (there is no terminating > nul in the file).
Without the patch `otool` shows the libga68 .dylib having a __GNU_A68 segment with a __a68_exports section in it. Maybe the system `as` (clang) "fixes" the name ? >> I suspect Pietro may have stumbled into some MacosX tool that actually >> expects that convention to be used? > > I don’t think any of the ones I regularly use would complain … but let > me know if there is one. There wasn't a complaint per-se. Loading export data from the dylib just didn't work due to the section name being different. >>> However, using the __ prefix convention is a good step, so OK from a Darwin >>> PoV. >> >> I also think that following conventions is the safest course. > > yeah, it stops people double-taking. > > Iain > >> >>> >>> Iain >>> >>>> >>>> Signed-off-by: Pietro Monteiro <[email protected]> >>>> --- >>>> gcc/algol68/a68.h | 6 +++++- >>>> 1 file changed, 5 insertions(+), 1 deletion(-) >>>> >>>> diff --git a/gcc/algol68/a68.h b/gcc/algol68/a68.h >>>> index 13603061290..c4895ae6527 100644 >>>> --- a/gcc/algol68/a68.h >>>> +++ b/gcc/algol68/a68.h >>>> @@ -73,7 +73,11 @@ enum >>>> /* The section name we use when reading and writing export data. */ >>>> >>>> #ifndef A68_EXPORT_SECTION_NAME >>>> -#define A68_EXPORT_SECTION_NAME ".a68_exports" >>>> +# ifdef OBJECT_FORMAT_MACHO >>>> +# define A68_EXPORT_SECTION_NAME "__a68_exports" >>>> +# else >>>> +# define A68_EXPORT_SECTION_NAME ".a68_exports" >>>> +# endif >>>> #endif >>>> >>>> /* ga68 export format definitions. See ga68-exports.pk. */ >>>> -- >>>> 2.43.0
