I need to know how to make a binary with gcc. I know how to create an obj file, but I'm not quite sure what to do about the linking part. I've gotten this far "gcc -c somefile.c somefile.o" then I'm left with an object file, but I don't see any linking command line options. Does anyone know how... (4 Replies)
Hi all,
I compile my c program and get following result
hrnpfc01.c:1387: stray '\' in program
hrnpfc01.c:1387: parse error before `,'
hrnpfc01.c:1388: stray '\' in program
hrnpfc01.c:1388: parse error before `,'
hrnpfc01.c:1396: stray '\' in program
hrnpfc01.c:1396: parse error before... (4 Replies)
hi, everybody£º
i have a question, pls help me¡£
OS : RS/6000 AIX 4.3.3
cPU : Powerpc,POWER3
compiler : gcc 3.2.3
source file £º 8M
OS kernel : 32 bit (selecting at installing operating system, the hardware support 64 bit)
when i compiling the large source file (8 M), i... (3 Replies)
Hi all,
Yeasterday I try to compile c program by using cygwin. I just find an errors the fist one is concerinig about the end of the line.
To summit my Assignment which is the day after tommorow I have to compile my c program by using just gcc.
If any one know what do I have to... (5 Replies)
I am new to comiling c/c++ programs with gcc compilier
unix - AIX version 5.3
gcc compiler version - 4.0.0
My makefile.
# makefile 1.0 08/20/98
#CC = cc
CC = gcc
ESQL = esql
CFLAGS = -Wall
DBSLIB=
DBSLIB=-L${INFORMIXDIR}/lib/esql -L${INFORMIXDIR}/lib `esql -libs`
ALL = hds_near... (9 Replies)
Hi All,
We are in the processing of upgrading our AIX server OS from 5.2.0.0 to 6.1. And we have a set of highly critical running C applications in AIX box. I have a question like whether this upgradation of OS will affect any C code compilation and C runtime enviornment...
how does AIX 6.1... (1 Reply)
Hi all!
I have posted in the Shell Programming Scripting Forum for a problem with the use of shc and so on...
You can read it complete here: shell-programming-scripting/148510-problems-using-shc.html
I think the problem is: that there aren't compiler installed on the SuSe 10.2 server,... (4 Replies)
I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Hi All,
I am trying to compile httpd2.2.19 in RHEL5.5 using gcc version 4.1.2. This is first time I am trying to compile httpd in RHEL.
I ran configure with below option
./configure --prefix=/usr/local/apache --enable-rewrite --enable-ssl=shared... (0 Replies)
I can't compile anything, the final make error says "Command failed for target `install-recursive'", but I am not able to identify the root cause of that error, I tried with cc, gcc 4.5, also gcc 5.2, using make, using gmake 3.82, ld 5.11, gld 2.31... and I am totally stuck yet... please help, to... (4 Replies)
Discussion started by: sugar222
4 Replies
LEARN ABOUT DEBIAN
x86_format_insn
x86_format_insn(3) libdisasm x86_format_insn(3)NAME
x86_format_insn, x86_format_mnemonic, x86_format_operand, x86_format_header - generate a string representation of a disassembled instruc-
tion.
SYNOPSIS
#include <libdis.h>
int x86_format_operand(x86_op_t *op, char *buf, int len,
enum x86_asm_format format);
int x86_format_mnemonic(x86_insn_t *insn, char *buf, int len,
enum x86_asm_format format );
int x86_format_insn(x86_insn_t *insn, char *buf, int len,
enum x86_asm_format format );
int x86_format_header( char *buf, int len,
enum x86_asm_format format);
DESCRIPTION
x86_format_insn generates an assembly-langauge representation of the disassembled instruction in the specified format. x86_format_mnemonic
and are called by x86_format_operand to format the instruction mnemonic and operands, respectively, but they may be invoked directly by
the user. Each of these routines fills buffer buf of len bytes with an ASCII string representing the instruction, mnemonic, or operand.
x86_format_header fills buffer buf of len bytes with a description of the specified format.
The following formats are available:
native_syntax : Intel syntax with address and hex
intel_syntax : Intel x86 syntax
att_syntax : AT&T Syntax
raw_syntax : Pipe-delimited internal format
xml_syntax : XML representation
Native syntax uses dest, src ordering and displays
the address, opcode bytes, and instruction in tab-delimited
format:
"ADDRESS BYTES MNEMONIC DEST SRC IMM"
Intel syntax uses dest, src ordering and displays the instruction in tab-and-comma delimited format:
"MNEMONIC DEST, SRC, IMM"
AT&T syntax uses src, destordering and displays the instruction in tab-and-comma delimited format:
"MNEMONIC SRC, DEST, IMM"
Raw syntax displays all details of the instruction in pipe-delimited format:
"ADDRESS|OFFSET|SIZE|BYTES|PREFIX|PREFIX_STRING|
XML syntax displays all details of the instruction in XML format:
GROUP|TYPE|NOTES|MNEMONIC|CPU|ISA|FLAGS_SET|
FLAGS_TESTED|STACK_MOD|STACK_MOD_VAL"
[|OP_TYPE|OP_DATATYPE|OP_ACCESS|OP_FLAGS|OP]*"
"<x86_insn>
<address rva= offset= size= bytes=/>
<prefix type= string=/>
<mnemonic group= type= string= cpu= isa= note= />
<flags type=set>
<flag name=>
</flags>
<stack_mod val= >
<flags type=tested>
<flag name=>
</flags>
<operand name=>
<register name= type= size=/>
<immediate type= value=/>
<relative_offset value=/>
<absolute_address value=>
<segment value=/>
</absolute_address>
<address_expression>
<segment value=/>
<base>
<register name= type= size=/>
</base>
<index>
<register name= type= size=/>
</index>
<scale>
<immediate value=/>
</scale>
<displacement>
<immediate value=/>
<address value=/>
</displacement>
</address_expression>
<segment_offset>
<address value=/>
</segment_offset>
</operand>
</x86_insn>"
EXAMPLES
The following will print insn in Intel syntax:
void att_print( x86_insn_t *insn ) {
char line[256];
x86_format_insn(insn, line, 256, intel_syntax);
printf( "%s
", line);
}
The following routine formats an instruction manually using AT&T syntax:
void manual_print( x86_insn_t *insn, void *arg ) {
char buf[128];
int i;
printf("%08lX", insn->addr );
for ( i = 0; i < 10; i++ ) {
if ( i < insn->size ) {
printf(" %02X", insn->bytes[i]);
} else {
printf(" ");
}
}
x86_format_mnemonic( insn, buf, 128, att_syntax );
printf( " %s ", buf );
if ( insn->operands[op_src].type != op_unused ) {
x86_format_operand( &insn->operands[op_src],
insn, buf, 128, att_syntax );
/* if src is present, so is dest */
printf("%s, ", buf);
}
if ( insn->operands[op_dest].type != op_unused ) {
x86_format_operand( &insn->operands[op_dest],
insn, buf, 128, att_syntax );
printf("%s", buf);
}
if ( insn->operands[op_imm].type != op_unused ) {
x86_format_operand( &insn->operands[op_imm],
insn, buf, 128, att_syntax );
/* if src is present, so is dest */
printf(", %s", buf);
}
printf("
");
}
SEE ALSO libdisasm(7), x86_disasm(3), x86_init(3), x86dis(1)mammon_ 0.21 x86_format_insn(3)