Operating System - HP-UX
1752796 Members
6368 Online
108789 Solutions
New Discussion юеВ

Re: Help with HP assembly

 
RATEFIARIVONY
Occasional Advisor

Help with HP assembly

Hi All,
I try to compile an hp assembly code with gcc3.2 on HP-UX 11.00 64-bit but I keep on receiving this: sh.s:1: Fatal error: Not in a space.

Below is the code
------------------
.SPACE $TEXT$
.SUBSPA $CODE$
.align 4
.EXPORT main,ENTRY

main
bl samplecode, %r1
nop

.SUBSPA $DATA$
.EXPORT samplecode

samplecode
xor %r26, %r26, %r26
copy %r26, %r25
copy %r26, %r24
ldil L'0xC0000000, 1
ble 4(%sr7,%r1)
addi,> 0x7e, %r0, %r22


It just execute setresuid(0,0,0).
What is worng ? Anyone have a clue ???
2 REPLIES 2
Dennis Handly
Acclaimed Contributor

Re: Help with HP assembly

I'm not sure about your foreign devil as(1) but HP's as(1) requires you to make these changes:
1) The target of a bl that does a call must be %r2. Calls to millicode must be %r31.

2) Your $DATA$ subspace must be in the $PRIVATE$ space. And code should NOT be in $DATA$. This maybe the cause of your error. You can use .text or .data pseudo-ops to get this right.
Bob E Campbell
Honored Contributor

Re: Help with HP assembly

The longer version of what Dennis said is in chapter 3 (page 47) of the PA-RISC Assembler manual:

http://docs.hp.com/en/92432-90012/92432-90012.pdf

I assume you already have that to have gotten that far, but wanted to make sure you weren't just having fun with disassemblers.