>> On 8 Jun 2026, at 15:23, Pietro Monteiro <[email protected]> wrote:
>> 
>> 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 don’t think so.
>
> e.g. posix.s ==> posix.o
>
>         .build_version macos,  15, 0
>         .section __GNU_A68,__a68_exports
>
> It looks like we are emitting this from the compiler already .. which kinda 
> stacks
> up with my recollection that we’d already been down this road - I do apologise
> that my recollection is fuzzy ..

So given we do:

  static void
  a68_switch_to_export_section (void)
  {
    static section *exports_sec;
  
    if (exports_sec == NULL)
      {
        gcc_assert (targetm_common.have_named_sections);
  #ifdef OBJECT_FORMAT_MACHO
        exports_sec
        = get_section (A68_EXPORT_SEGMENT_NAME "," A68_EXPORT_SECTION_NAME,
                       SECTION_DEBUG, NULL);
  #else
        exports_sec = get_section (A68_EXPORT_SECTION_NAME,
                                 TARGET_AIX_OS ? SECTION_EXCLUDE : 
SECTION_DEBUG,
                                 NULL);
  #endif
      }
  
    switch_to_section (exports_sec);
  }

It must be either get_section that is turning __GNU_A68,.a68_exports
into __GNU_A68,__a68_exports, or there is something down the pipeline
doing that subst in macos targets..


>
> Iain

Reply via email to