-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathbfd.replacements
97 lines (81 loc) · 4.26 KB
/
bfd.replacements
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
convert c: #define bfd_set_section_vma(bfd, ptr, val) (((ptr)->vma = (ptr)->lma = (val)), ((ptr)->user_set_vma = TRUE), TRUE)
to fb:
#macro bfd_set_section_vma(bfd, ptr, val)
scope
var __val = (val)
(ptr)->vma = __val
(ptr)->lma = __val
(ptr)->user_set_vma = CTRUE
end scope
#endmacro
convert c:
static inline bfd_boolean bfd_set_section_vma(bfd *abfd __attribute__((__unused__)), asection *ptr, bfd_vma val) { \
ptr->vma = ptr->lma = val; \
ptr->user_set_vma = 1; \
return 1; \
}
to c:
static inline bfd_boolean bfd_set_section_vma(bfd *abfd __attribute__((__unused__)), asection *ptr, bfd_vma val) { \
ptr->vma = val; \
ptr->lma = val; \
ptr->user_set_vma = 1; \
return 1; \
}
convert c: #define bfd_set_section_alignment(bfd, ptr, val) (((ptr)->alignment_power = (val)),TRUE)
to c: #define bfd_set_section_alignment(bfd, ptr, val) ((ptr)->alignment_power = (val))
convert c: #define bfd_set_section_userdata(bfd, ptr, val) (((ptr)->userdata = (val)),TRUE)
to c: #define bfd_set_section_userdata(bfd, ptr, val) ((ptr)->userdata = (val))
convert c: #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) (warn_deprecated ("bfd_read", __FILE__, __LINE__, __FUNCTION__), bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
to c: #define bfd_read(BUF, ELTSIZE, NITEMS, ABFD) bfd_bread ((BUF), (ELTSIZE) * (NITEMS), (ABFD))
convert c: #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) (warn_deprecated ("bfd_write", __FILE__, __LINE__, __FUNCTION__), bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD)))
to c: #define bfd_write(BUF, ELTSIZE, NITEMS, ABFD) bfd_bwrite ((BUF), (ELTSIZE) * (NITEMS), (ABFD))
convert c: #define bfd_set_cacheable(abfd,bool) (((abfd)->cacheable = bool), TRUE)
to c: #define bfd_set_cacheable(abfd,bool) ((abfd)->cacheable = bool)
convert c: #define bfd_put_8(abfd, val, ptr) ((void) (*((unsigned char *) (ptr)) = (val) & 0xff))
to c: #define bfd_put_8(abfd, val, ptr) ((*((unsigned char *) (ptr)) = (val) & 0xff))
convert c:
#define bfd_get(bits, abfd, ptr) \
((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) : \
(bits) == 16 ? bfd_get_16 (abfd, ptr) : \
(bits) == 32 ? bfd_get_32 (abfd, ptr) : \
(bits) == 64 ? bfd_get_64 (abfd, ptr) : \
(abort (), (bfd_vma) - 1))
to c:
#define bfd_get(bits, abfd, ptr) \
((bits) == 8 ? (bfd_vma) bfd_get_8 (abfd, ptr) : \
(bits) == 16 ? bfd_get_16 (abfd, ptr) : \
(bits) == 32 ? bfd_get_32 (abfd, ptr) : \
(bits) == 64 ? bfd_get_64 (abfd, ptr) : \
(bfd_vma) - 1)
convert c:
#define bfd_put(bits, abfd, val, ptr) \
((bits) == 8 ? bfd_put_8 (abfd, val, ptr) : \
(bits) == 16 ? bfd_put_16 (abfd, val, ptr) : \
(bits) == 32 ? bfd_put_32 (abfd, val, ptr) : \
(bits) == 64 ? bfd_put_64 (abfd, val, ptr) : \
(abort (), (void) 0))
to fb:
#macro bfd_put(bits, abfd, val, ptr)
select case bits
case 8 : bfd_put_8(abfd, val, ptr)
case 16 : bfd_put_16(abfd, val, ptr)
case 32 : bfd_put_32(abfd, val, ptr)
case 64 : bfd_put_64(abfd, val, ptr)
case else
abort()
end select
#endmacro
convert c: #define BFD_SEND_FMT(bfd, message, arglist) (((bfd)->xvec->message[(int) ((bfd)->format)]) arglist)
to fb: #define BFD_SEND_FMT(bfd, message, arglist) (((bfd)->xvec->message[ clng((bfd)->format)]) arglist)
convert c: #define bfd_get_section_name(bfd, ptr) ((void) bfd, (ptr)->name)
to c: #define bfd_get_section_name(bfd, ptr) ( (ptr)->name)
convert c: #define bfd_get_section_vma(bfd, ptr) ((void) bfd, (ptr)->vma)
to c: #define bfd_get_section_vma(bfd, ptr) ( (ptr)->vma)
convert c: #define bfd_get_section_lma(bfd, ptr) ((void) bfd, (ptr)->lma)
to c: #define bfd_get_section_lma(bfd, ptr) ( (ptr)->lma)
convert c: #define bfd_get_section_alignment(bfd, ptr) ((void) bfd, (ptr)->alignment_power)
to c: #define bfd_get_section_alignment(bfd, ptr) ( (ptr)->alignment_power)
convert c: #define bfd_get_section_flags(bfd, ptr) ((void) bfd, (ptr)->flags)
to c: #define bfd_get_section_flags(bfd, ptr) ( (ptr)->flags)
convert c: #define bfd_get_section_userdata(bfd, ptr) ((void) bfd, (ptr)->userdata)
to c: #define bfd_get_section_userdata(bfd, ptr) ( (ptr)->userdata)