sparc

Sparc Function compilation alignment

半城伤御伤魂 提交于 2019-12-13 12:50:37
问题 I want my program such that each function in the binary has some space left after it ends. So that later if some minor change is required only that function is changed with the extra space acting as room for accounting the minor change. -falign-function can do the job but it will not give consistent space. Is there anyway to do it? Or better way to do it? 回答1: You could use an inline assembly statement to add a series of nops at the start (or end) of each function. Then later when you need to

Just one source code can be used on Solaris 11 sparc and x86?

ε祈祈猫儿з 提交于 2019-12-13 02:14:32
问题 I've made some access control program with PAM, and it can be compiled on Solaris 11 sparc and x86 now. I know that the architecture is difference between sparc and x86. Would I test on each platform? or just one platform case? thank you, read it. 回答1: It is hard to tell without knowing precisely what APIs and features your program is using but assuming it compiles well in both platforms and works fine in one of them, the risk for it to fail in the other is extremely low. Solaris is built

Debugging open() command call with truss

拟墨画扇 提交于 2019-12-12 04:49:50
问题 Using truss -t'open' $(program_call) I get: open("command.txt", O_RDONLY|O_NONBLOCK) = 5 response FIFO file descriptor = -1 // Open call was literally sandwiched between print commands, but its not here? response FIFO file descriptor = 9 open("response.txt", O_WRONLY|O_NONBLOCK) Err#6 ENXIO response.txt: No such device or address The thing is, I initialized the file descriptor to -1, so I KNOW that the open call must have succeeded because it changed the value of the variable. The file

sparc assembly load and store

断了今生、忘了曾经 提交于 2019-12-11 22:45:25
问题 Hi I have been looking online all over and my book just doesn't explain enough regarding how the load instructions work for Sparc assembly. ldsb - load signed byte ldub - load unsigned byte ldsh - load signed half word Lduh - load unsigned half word Ld - load word Ldd - load double I also know a byte is 8 bits and that is 2 hex digits, half is 16 bits, and word is 32 bits. So looking at this example with the solutions below can someone explain how to arrive to do that answer. The first column

SPARC Assembly Language

大兔子大兔子 提交于 2019-12-11 16:49:30
问题 I am trying to run a sample Sparc assembly language , but I am not even sure where to start. I tried vim macro or m4 example.m but I dont know where and how to compile it. I searched the internet, read articles, but none of them mentioned how to start coding. for example, I would like to type this assembly language : .global main main: save %sp, -96, %sp mov PROMPT, %o0 call writeChar nop call readInt what commend should I use to compile and run ? (using Linux) 回答1: You don't "compile"

Two copies of constant appearing in the compiled Elf

纵然是瞬间 提交于 2019-12-11 15:06:09
问题 We are basically using sparc architecture and our language is Ada we are using gnat compiler to compile our code. We observed something funny. Some of the constant in our code are having two or more copies. file.adb: With FileConsts; USE FileConsts Procedure SomeProcedure is A : LONG_FLOAT; Begin A := cSomeConstant; End SomeProcedure; FileConsts.ads cSomeConstant : CONSTANT LONG_FLOAT := 100.0; In the Map file we have basically .rodata 0x40010000 (0x8)file.o .rodata 0x40010008 pfileconsts_

SPARC Assembly question

旧时模样 提交于 2019-12-11 08:47:22
问题 I wanna write a very simple inline assembly routine in my C program which does nothing else then setting the local registers %l0 - %l7 to different values. I tried the following straightforward approach: asm volatile ( ".text\n\t" "mov 0, %%l0 \n\t" "mov 1, %%l1 \n\t" "mov 2, %%l2 \n\t" "mov 3, %%l3 \n\t" "mov 4, %%l4 \n\t" "mov 5, %%l5 \n\t" "mov 6, %%l6 \n\t" "mov 7, %%l7 \n\t" ); unfortuantely, the assembler tells: illegal operand for each instruction. Could somebody please be so nice to

How to avoid insn beeing scheduled into a delay slot

拜拜、爱过 提交于 2019-12-11 03:33:44
问题 I try to patch gcc so that after a fdivd the destination register is stored to the stack,i.e: fdivd %f0, %f2, %f4; => becomes fdivd %f0, %f2, %f4; std %f4, [%fp+...] I generate the rtl for divdf3 using a (emit_insn,DONE) sequence in a define_expand pattern (see below). In the assembler output phase I use a define_insn and write out "fdivd\t%%1, %%2, %%0; std %%0, %%3" as the expression string. The code generated seems to be ok. However: My question: How can I mark the pattern so, that it will

Can 32-bit SPARC V8 application run on 64-bit SPARC V9?

时光总嘲笑我的痴心妄想 提交于 2019-12-10 23:39:28
问题 I have few benchmark application complied for SPARC V8 32-bit architecture. I used them for performance evaluation of SPARC 32-bit processor. However, few application fall short of in performance. I want to test the performance with a 64-bit SPARC V9 architecture ( like OpenSPARC T1/T2). My question is will the compiled binaries for the 32-bit SPARC V8 architecture run in SPARC V9 architecture without any modifications? Are the binaries in both architectures compatible? 回答1: Presuming that

Cross compiling for SPARC on x86

女生的网名这么多〃 提交于 2019-12-10 10:43:58
问题 I've seen the about cross compilers reply at How do I cross-compile C code on Windows for a binary to also be run on Unix (Solaris/HPUX/Linux)? I would like to know how can Y compile for SPARC on a x86 machine? Where can i find a good cross compiler? I also need to compile for HP OS. 回答1: gcc is fully capable of this. Sun's compiler may be capable, but I'm more familiar with gcc. First, you should get comfortable with building gcc, and also decide if you need just the C compiler or if you