I realise this is a bug for a long since discontinued operating system - apologies for that.
The SGI enthusiast community is in the process of trying to get more modern tools up and running for these machines - and right now we have a mostly OK gcc8.2.0 for C when using binutils-2.19.
When using binutils-2.32 - LD doesn't produce valid executables - launching them in DBX shows the following:
Now execute givenfile with the following call:
Warning: SymbolTableDwarf: RA register is DW_FRAME_UNDEFINED_VAL in frame 1034, pc 0xfae43c0
Process 1699 (exe.gcc8.gitld) started
Process 1699 (exe.gcc8.gitld) stopped on signal SIGSEGV: Segmentation violation (default) at [build_entire_object_list:446 ,0xfb6ff6c]
Source (of /j7/mtibuild/v744/workarea/v7.4.4m/rld/rld_startup.c) not available for Process 1699
> 0 build_entire_object_list(0xfbd7c58, 0x2, 0x7ffd7da0, 0x34, 0x0, 0x0, 0x76, 0x2) ["/j7/mtibuild/v744/workarea/v7.4.4m/rld/rld_startup.c":446, 0xfb6ff6c]
1 read_aux_vec_and_build_objlist(0x2, 0x10000000, 0x40, 0x34, 0x0, 0x0, 0x76, 0x2) ["/j7/mtibuild/v744/workarea/v7.4.4m/rld/rld_startup.c":1508, 0xfb71104]
2 sgi_main(0x0, 0x7ffd7f54, 0x7ffd7f54, 0x34, 0x0, 0x0, 0x76, 0x2) ["/j7/mtibuild/v744/workarea/v7.4.4m/rld/rld_startup.c":1648, 0xfb71344]
3 newmain() ["/j7/mtibuild/v744/workarea/v7.4.4m/rld/rld_newmain.s":68, 0xfb60184]
Notably - GAS seems fine and using an earlier LD with 2.32 GAS will produce valid executables.
You can find some built binaries and some readelf dumps of them here:
The failing executable there is this one:
If it helps at all,
I did bisect which commit broke the linking - and as far as I can tell -
There was a commit 19 Sep 2010 that did some re-work of the BFD mips handling:
The previous commit where I still see success in building gcc using gas/gld - is here:
Created attachment 11889 [details]
roll back changes to local/global symbol relocation for irix linker
The above is patch against binutils 2.21.
I don't want (or expect) these changes to be merged - but someone might find this useful.
Created attachment 11894 [details]
patch against 2.26.1 that gets irix binaries working once more