Weird aspect of mipspro
#1
Weird aspect of mipspro
Does uh, any other non GCC compiler support #pragma comment as a way to insert comments into a finished binary? 

Apparently not only does mipspro support this, but I've never seen it used on any other compiler.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
01-01-2025, 03:45 PM
#2
RE: Weird aspect of mipspro
I believe the syntax is
Code:
#pragma ident "$Revision: 69.69 $"
based on the discussion here.

However, the compiler also supports SCCS tags using the #ident preprocessor command,
Code:
#ident  "$Revision: 1.46 $"
which is the usual syntax. This is traditional Unix SCCS stuff and every Unix C compiler has it.

Personaliris O2 Indigo2 R10000/IMPACT Indigo2 R10000/IMPACT Indigo2 Indy   (past: 4D70GT)
robespierre
refector peritus

Trade Count: (0)
Posts: 640
Threads: 3
Joined: Nov 2020
Location: Massholium
Find Reply
01-01-2025, 06:27 PM
#3
RE: Weird aspect of mipspro
I didn't know that #ident was the equivalent but the way that mipspro stores text symbols is unusual.

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
01-01-2025, 06:32 PM
#4
RE: Weird aspect of mipspro
Using macros is old school and bypasses relevant compiler warnings, use const char instead.

Project: Temporarily lost at sea
Plan: World domination! Or something...
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,245
Threads: 41
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
01-02-2025, 12:27 AM
#5
RE: Weird aspect of mipspro
What do you mean? What if you want to leave a message in the binary for debugging purposes? Just leave it as a const char variable?

Also you'd have a headache based on how SGI handled pragmas.

#pragma set woff is used liberally in doprnt.c (the libc printf implementation. We are currently reversed engineering it and apparently it's used like 10 times in that file.)

I'm the system admin of this site. Private security technician, licensed locksmith, hack of a c developer and vintage computer enthusiast. 

https://contrib.irixnet.org/raion/ -- contributions and pieces that I'm working on currently. 

https://codeberg.org/SolusRaion -- Code repos I control

Technical problems should be sent my way.
Raion
Chief IRIX Officer

Trade Count: (9)
Posts: 4,240
Threads: 533
Joined: Nov 2017
Location: Eastern Virginia
Website Find Reply
01-02-2025, 03:52 AM
#6
RE: Weird aspect of mipspro
All you have to do is run the strings program on the binary, thus finding out what text the programmers thought was important enough to program in.

Project: Temporarily lost at sea
Plan: World domination! Or something...
(This post was last modified: 01-02-2025, 04:07 AM by vishnu.)
vishnu
Tezro, Octane2, 2 x Onyx4

Trade Count: (0)
Posts: 1,245
Threads: 41
Joined: Dec 2017
Location: Minneapolis, Minnesota USA
Find Reply
01-02-2025, 04:03 AM


Forum Jump:


Users browsing this thread: 1 Guest(s)