Skip to content

Commit ccc1ff8

Browse files
committed
updated gsmk hexagon module, using newer binutils - with hexagon v5.5 support.
1 parent a3ae18e commit ccc1ff8

File tree

12 files changed

+13425
-239
lines changed

12 files changed

+13425
-239
lines changed

Makefile

Lines changed: 0 additions & 69 deletions
This file was deleted.

Makefile.linux

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
include ../idacfg.mk
2+
3+
all:
4+
5+
# I put some not yet published targets in this optional include
6+
-include Makefile.extra
7+
8+
CXX=clang++
9+
CC=clang
10+
LD=clang++
11+
12+
TARGETS+=hexagon.ilx
13+
14+
# where the quicinc objdump source can be found
15+
gnutools= hx/sourceryg++-2012.03-151-hexagon/binutils-hexagon-2012.03
16+
17+
gnutoolsincludes=-I $(gnutools)/include -I $(gnutools)/bfd -I $(gnutools)/include/opcode
18+
gnutoolsincludes+=-I ./build-mac/opcodes -I ./build-mac/bfd
19+
CFLAGS=-g -D__MAC__ -D__IDP__ -I $(idasdk)/include
20+
CFLAGS+=-DUSE_STANDARD_FILE_FUNCTIONS
21+
CFLAGS+=-DUSE_DANGEROUS_FUNCTIONS
22+
CFLAGS+=-D_FORTIFY_SOURCE=0
23+
CFLAGS+=-O0 -g -fpic
24+
25+
# add this flag when you want verbose logging
26+
#CFLAGS+=-DTRACELOG
27+
28+
all: $(TARGETS)
29+
30+
hexagon.ilx: hexagon.o32 gt_safe-ctype.o32 gt_hexagon-dis.o32 gt_hexagon-opc.o32 gt_hexagon-isa.o32 bfd_funcs.o32 gt_cpu-hexagon.o32 dummy-scan.o32
31+
cflags_cpu-hexagon= $(gnutoolsincludes)
32+
cflags_hexagon= $(gnutoolsincludes)
33+
cflags_bfd_funcs= $(gnutoolsincludes)
34+
35+
install: hexagon.ilx
36+
cp $^ "$(idabin)/procs"
37+
38+
clean:
39+
$(RM) $(TARGETS) $(wildcard *.o) $(wildcard *.o32)
40+
41+
42+
%.o32: %.cpp
43+
$(CXX) -m32 -std=c++11 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
44+
%.o32: %.c
45+
$(CC) -m32 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
46+
47+
gt_%.o32: $(gnutools)/libiberty/%.c
48+
$(CC) -m32 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
49+
50+
gt_%.o32: $(gnutools)/opcodes/%.c
51+
$(CC) -m32 -c -Wstrict-prototypes -Wmissing-prototypes -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
52+
53+
gt_%.o32: $(gnutools)/bfd/%.c
54+
$(CC) -m32 -c -Wstrict-prototypes -Wmissing-prototypes -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
55+
56+
%.o32: %.s
57+
$(CXX) -c -m32 -o$@ $^
58+
59+
%.ilx: %.o32
60+
$(LD) -shared -m32 -o $@ $^ "$(idabin)/libida.so"
61+
62+
%: %.o
63+
$(CXX) -g -o $@ $^
64+
65+
%32: %.o32
66+
$(CXX) -m32 -g -o $@ $^
67+

Makefile.osx

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
include ../idacfg.mk
2+
3+
all:
4+
5+
# I put some not yet published targets in this optional include
6+
-include Makefile.extra
7+
8+
CXX=clang++
9+
CC=clang
10+
LD=clang++
11+
12+
TARGETS+=hexagon.imc
13+
14+
# where the quicinc objdump source can be found
15+
gnutools= hx/sourceryg++-2012.03-151-hexagon/binutils-hexagon-2012.03
16+
17+
gnutoolsincludes=-I $(gnutools)/include -I $(gnutools)/bfd -I $(gnutools)/include/opcode
18+
gnutoolsincludes+=-I ./build-mac/opcodes -I ./build-mac/bfd
19+
CFLAGS=-g -D__MAC__ -D__IDP__ -I $(idasdk)/include
20+
CFLAGS+=-DUSE_STANDARD_FILE_FUNCTIONS
21+
CFLAGS+=-DUSE_DANGEROUS_FUNCTIONS
22+
CFLAGS+=-D_FORTIFY_SOURCE=0
23+
CFLAGS+=-O0 -g
24+
25+
# add this flag when you want verbose logging
26+
#CFLAGS+=-DTRACELOG
27+
28+
all: $(TARGETS)
29+
30+
hexagon.imc: hexagon.o32 gt_safe-ctype.o32 gt_hexagon-dis.o32 gt_hexagon-opc.o32 gt_hexagon-isa.o32 bfd_funcs.o32 gt_cpu-hexagon.o32 dummy-scan.o32
31+
cflags_cpu-hexagon= $(gnutoolsincludes)
32+
cflags_hexagon= $(gnutoolsincludes)
33+
cflags_bfd_funcs= $(gnutoolsincludes)
34+
35+
install: hexagon.imc
36+
cp $^ "$(idabin)/procs"
37+
38+
clean:
39+
$(RM) $(TARGETS) $(wildcard *.o) $(wildcard *.o32)
40+
41+
42+
%.o32: %.cpp
43+
$(CXX) -m32 -std=c++11 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
44+
%.o32: %.c
45+
$(CC) -m32 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
46+
47+
gt_%.o32: $(gnutools)/libiberty/%.c
48+
$(CC) -m32 -c -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
49+
50+
gt_%.o32: $(gnutools)/opcodes/%.c
51+
$(CC) -m32 -c -Wstrict-prototypes -Wmissing-prototypes -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
52+
53+
gt_%.o32: $(gnutools)/bfd/%.c
54+
$(CC) -m32 -c -Wstrict-prototypes -Wmissing-prototypes -o$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
55+
56+
%.o32: %.s
57+
$(CXX) -c -m32 -o$@ $^
58+
59+
%.imc: %.o32
60+
$(LD) -dynamiclib -m32 -o $@ $^ "$(idabin)/libida.dylib"
61+
62+
%: %.o
63+
$(CXX) -g -o $@ $^
64+
65+
%32: %.o32
66+
$(CXX) -m32 -g -o $@ $^
67+

Makefile.w32

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,22 @@
1-
# the name under which this processor module is listed by IDA
2-
DESCRIPTION=Qualcomm Hexagon DSP v4:QDSP6
1+
include ../idacfg.mk
32

43
all:
54

65
#vc=c:/Program Files/Microsoft Visual Studio 8/VC
76
#winsdk=$(vc)/platformsdk
8-
vc=c:/Program Files/Microsoft Visual Studio 10.0/VC
9-
winsdk=C:/Program Files/Microsoft SDKs/Windows/v7.0A
7+
vc=c:/Program Files (x86)/Microsoft Visual Studio 14.0/VC
8+
winsdk=C:/Program Files (x86)/Windows Kits/10
109
CXX=$(vc)/bin/cl.exe
1110
CC=$(vc)/bin/cl.exe
1211
LD=$(vc)/bin/link.exe
1312

1413
TARGETS+=hexagon.w32
1514

16-
# set some paths to external libraries
17-
idasdk=z:/sources/idasdk64
18-
idabin=c:/local/ida620
19-
2015
# where the quicinc objdump source can be found
21-
gnutools=z:/projects/iphone/hexagon/source-wj/gnutools
16+
gnutools= hx/sourceryg++-2012.03-151-hexagon/binutils-hexagon-2012.03
2217

23-
gnutoolsincludes=-I $(gnutools)/include -I $(gnutools)/bfd -I $(gnutools)/build_mac/opcodes -I $(gnutools)/build_mac/bfd -I $(gnutools)/include/opcode
18+
gnutoolsincludes=-I $(gnutools)/include -I $(gnutools)/bfd -I $(gnutools)/include/opcode
19+
gnutoolsincludes+=-I build-win/opcodes -I build-win/bfd
2420
CFLAGS=-EHsc -GR -Gz -nologo -Zi -D__NT__ -D__IDP__ -I $(idasdk)/include -I $(BOOST)
2521
CFLAGS+=-I "$(vc)/include" -I "$(winsdk)/include" -D_WIN32 -DWIN32 -D_USRDLL -DMAXSTR=1024
2622
CFLAGS+=-O2
@@ -35,32 +31,36 @@ LDFLAGS=-debug -nologo -dll -export:LPH -stub:$(idasdk)/module/stub
3531

3632
all: $(TARGETS)
3733

38-
hexagon.w32: hexagon.obj gt_safe-ctype.obj gt_hexagon-dis.obj gt_hexagon-opc.obj bfd_funcs.obj
34+
hexagon.w32: hexagon.obj gt_safe-ctype.obj gt_hexagon-dis.obj gt_hexagon-opc.obj bfd_funcs.obj gt_hexagon-isa.obj gt_cpu-hexagon.obj dummy-scan.obj
3935
cflags_hexagon= $(gnutoolsincludes)
4036
cflags_bfd_funcs= $(gnutoolsincludes)
4137

4238
install: hexagon.w32
4339
cp $^ "$(idabin)/procs"
4440

4541
clean:
46-
$(RM) $(TARGETS) $(wildcard *.obj) $(GENERATEDFILES)
42+
$(RM) $(TARGETS) $(wildcard *.obj) $(GENERATEDFILES) hexagon.exp hexagon.ilk hexagon.lib hexagon.pdb vc140.pdb
4743

4844

4945

5046

5147
%.obj: %.cpp
52-
"$(CXX)" -c -Wall -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
48+
"$(CXX)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS) $(CXXFLAGS)
49+
%.obj: %.c
50+
"$(CC)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(CFLAGS)
5351

5452
gt_%.obj: $(gnutools)/libiberty/%.c
55-
"$(CC)" -c -Wall -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
53+
"$(CC)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
5654

5755
gt_%.obj: $(gnutools)/opcodes/%.c
58-
"$(CC)" -c -Wall -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
56+
"$(CC)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
57+
58+
gt_%.obj: $(gnutools)/bfd/%.c
59+
"$(CC)" -c -Fo$@ $^ $(cflags_$(basename $(notdir $@))) $(gnutoolsincludes) $(CFLAGS)
5960

6061
%.obj: %.s
6162
"$(CXX)" -c -Fo$@ $^
6263

6364
%.w32: %.obj
6465
"$(LD)" $(LDFLAGS) -out:$@ $^ $(LDLIBS)
65-
$(subst \,/,$(idasdk))/bin/mkidp.exe $@ "$(DESCRIPTION)"
6666

0 commit comments

Comments
 (0)