aboutsummaryrefslogtreecommitdiff
path: root/packages/elf2flt/git-453398f9/0001-elf2flt-Use-PRIx64-instead-of-BFD_VMA_FMT-x.patch
blob: 6836b18074dd8bb3f0e0e0ef5e42d4879ee27210 (plain)
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
From 50c80021f3351596f75f8dfc06ec45f8a598eb7e Mon Sep 17 00:00:00 2001
From: Chris Packham <judge.packham@gmail.com>
Date: Mon, 27 Feb 2023 20:47:04 +1300
Subject: [PATCH] elf2flt: Use PRIx64 instead of BFD_VMA_FMT"x

As of binutils 2.40 bfd.h no longer defines BFD_VMA_FMT. Use PRIx64
instead.

Signed-off-by: Chris Packham <judge.packham@gmail.com>
---
 elf2flt.c | 36 ++++++++++++++++++------------------
 1 file changed, 18 insertions(+), 18 deletions(-)

diff --git a/elf2flt.c b/elf2flt.c
index 8dbd9b2..4ec4103 100644
--- a/elf2flt.c
+++ b/elf2flt.c
@@ -216,7 +216,7 @@ dump_symbols(asymbol **symbol_table, long number_of_symbols)
   long i;
   printf("SYMBOL TABLE:\n");
   for (i=0; i<number_of_symbols; i++) {
-	printf("  NAME=%s  VALUE=0x%"BFD_VMA_FMT"x\n",
+	printf("  NAME=%s  VALUE=0x%"PRIx64"\n",
 		symbol_table[i]->name, symbol_table[i]->value);
   }
   printf("\n");
@@ -452,7 +452,7 @@ output_relocs (
 	if (r == NULL)
 	  continue;
 	if (verbose)
-	  printf(" RELOCS: %s [%p]: flags=0x%x vma=0x%"BFD_VMA_FMT"x\n",
+	  printf(" RELOCS: %s [%p]: flags=0x%x vma=0x%"PRIx64"\n",
 			r->name, r, r->flags, elf2flt_bfd_section_vma(abs_bfd, r));
   	if ((r->flags & SEC_RELOC) == 0)
   	  continue;
@@ -879,8 +879,8 @@ output_relocs (
 					if (verbose)
 						fprintf(stderr,
 							"%s vma=0x%x, "
-							"value=0x%"BFD_VMA_FMT"x, "
-							"address=0x%"BFD_VMA_FMT"x "
+							"value=0x%"PRIx64", "
+							"address=0x%"PRIx64" "
 							"sym_addr=0x%x rs=0x%x, opcode=0x%x\n",
 							"ABS32",
 							sym_vma, (*(q->sym_ptr_ptr))->value,
@@ -898,8 +898,8 @@ output_relocs (
 					if (verbose)
 						fprintf(stderr,
 							"%s vma=0x%x, "
-							"value=0x%"BFD_VMA_FMT"x, "
-							"address=0x%"BFD_VMA_FMT"x "
+							"value=0x%"PRIx64", "
+							"address=0x%"PRIx64" "
 							"sym_addr=0x%x rs=0x%x, opcode=0x%x\n",
 							"PLT32",
 							sym_vma, (*(q->sym_ptr_ptr))->value,
@@ -921,7 +921,7 @@ output_relocs (
 				case R_V850_ZDA_16_16_OFFSET:
 				case R_V850_ZDA_16_16_SPLIT_OFFSET:
 					/* Can't support zero-relocations.  */
-					printf ("ERROR: %s+0x%"BFD_VMA_FMT"x: zero relocations not supported\n",
+					printf ("ERROR: %s+0x%"PRIx64": zero relocations not supported\n",
 							sym_name, q->addend);
 					continue;
 #endif /* TARGET_v850 */
@@ -1014,15 +1014,15 @@ output_relocs (
 			sprintf(&addstr[0], "+0x%ld", sym_addr - (*(q->sym_ptr_ptr))->value -
 					 elf2flt_bfd_section_vma(abs_bfd, sym_section));
 			if (verbose)
-				printf("  RELOC[%d]: offset=0x%"BFD_VMA_FMT"x symbol=%s%s "
+				printf("  RELOC[%d]: offset=0x%"PRIx64" symbol=%s%s "
 					"section=%s size=%d "
-					"fixup=0x%x (reloc=0x%"BFD_VMA_FMT"x)\n",
+					"fixup=0x%x (reloc=0x%"PRIx64")\n",
 					flat_reloc_count,
 					q->address, sym_name, addstr,
 					section_name, sym_reloc_size,
 					sym_addr, section_vma + q->address);
 			if (verbose)
-				printf("reloc[%d] = 0x%"BFD_VMA_FMT"x\n",
+				printf("reloc[%d] = 0x%"PRIx64"\n",
 					 flat_reloc_count, section_vma + q->address);
 
 					continue;
@@ -1139,9 +1139,9 @@ output_relocs (
 					temp |= (exist_val & 0x3f);
 					*(unsigned long *)r_mem = htoniosl(temp);
 					if (verbose)
-						printf("omit: offset=0x%"BFD_VMA_FMT"x symbol=%s%s "
+						printf("omit: offset=0x%"PRIx64" symbol=%s%s "
 								"section=%s size=%d "
-								"fixup=0x%x (reloc=0x%"BFD_VMA_FMT"x) GPREL\n",
+								"fixup=0x%x (reloc=0x%"PRIx64") GPREL\n",
 								q->address, sym_name, addstr,
 								section_name, sym_reloc_size,
 								sym_addr, section_vma + q->address);
@@ -1159,9 +1159,9 @@ output_relocs (
 					exist_val |= ((sym_addr & 0xFFFF) << 6);
 					*(unsigned long *)r_mem = htoniosl(exist_val);
 					if (verbose)
-						printf("omit: offset=0x%"BFD_VMA_FMT"x symbol=%s%s "
+						printf("omit: offset=0x%"PRIx64" symbol=%s%s "
 								"section=%s size=%d "
-								"fixup=0x%x (reloc=0x%"BFD_VMA_FMT"x) PCREL\n",
+								"fixup=0x%x (reloc=0x%"PRIx64") PCREL\n",
 								q->address, sym_name, addstr,
 								section_name, sym_reloc_size,
 								sym_addr, section_vma + q->address);
@@ -1176,7 +1176,7 @@ output_relocs (
 					    && (p[-1]->sym_ptr_ptr == p[0]->sym_ptr_ptr)
 					    && (p[-1]->addend == p[0]->addend)) {
 						if (verbose)
-							printf("omit: offset=0x%"BFD_VMA_FMT"x symbol=%s%s "
+							printf("omit: offset=0x%"PRIx64" symbol=%s%s "
 								"section=%s size=%d LO16\n", 
 								q->address, sym_name, addstr,
 								section_name, sym_reloc_size);
@@ -1586,9 +1586,9 @@ DIS29_RELOCATION:
 			}
 
 			if (verbose)
-				printf("  RELOC[%d]: offset=0x%"BFD_VMA_FMT"x symbol=%s%s "
+				printf("  RELOC[%d]: offset=0x%"PRIx64" symbol=%s%s "
 					"section=%s size=%d "
-					"fixup=0x%x (reloc=0x%"BFD_VMA_FMT"x)\n",
+					"fixup=0x%x (reloc=0x%"PRIx64")\n",
 					flat_reloc_count,
 					q->address, sym_name, addstr,
 					section_name, sym_reloc_size,
@@ -1606,7 +1606,7 @@ DIS29_RELOCATION:
 					(section_vma + q->address);
 
 				if (verbose)
-					printf("reloc[%d] = 0x%"BFD_VMA_FMT"x\n",
+					printf("reloc[%d] = 0x%"PRIx64"\n",
 							flat_reloc_count, section_vma + q->address);
 #else
 				switch ((*p)->howto->type) {
-- 
2.39.1