Skip to content

m68k: Elf2Mac failing on computed gotos #275

@ftrvxmtrx

Description

@ftrvxmtrx

The minimal repro I came up with, along with a workaround (putting the table into a .text section):

// m68k-apple-macos-gcc THIS_FILE.c
int main(){
        //__attribute__((section(".text.cursed")))
        static const void * const m[] = {&&a};
        goto *m[0];
a:      return 0;
}

Without the attribute I get the following:

Invalid ref from .data:20 to .code00002()+10240
Assertion failed: sym.section.get() == this (/home/ftrvx/w/_/retro68/Elf2Mac/Section.cc: FixRelocs: 238)
collect2: fatal error: ld terminated with signal 6 [Aborted]
compilation terminated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions