commit 0dda10db471ab5359b1c88e21f2ff341fca776f6 parent 9af5a6c440bf1a94c7952a321d6355e64156edd2 Author: Roberto E. Vargas Caballero <k0ga@shike2.com> Date: Sat, 18 Jan 2025 10:16:19 +0100 libmach/coff32: Make public coff32.h There are some utilities that are going to need low level access to the internal data, and instead of adding very specific interfaces without actual reusability use case it is better to implement these functionalities directly in these applications (like for example in the case of objdump). Diffstat:
18 files changed, 17 insertions(+), 18 deletions(-)
diff --git a/src/libmach/coff32/coff32.h b/include/bits/scc/coff32.h diff --git a/src/libmach/coff32/coff32.c b/src/libmach/coff32/coff32.c @@ -1,9 +1,9 @@ #include <stdio.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" struct objops coff32 = { .type = coff32type, diff --git a/src/libmach/coff32/coff32archs.c b/src/libmach/coff32/coff32archs.c @@ -1,9 +1,9 @@ #include <stdio.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" struct arch coff32archs[] = { {"coff32-i386", "\x4c\x01", OBJ(COFF32, ARCH386, LITTLE_ENDIAN), 0x0105}, diff --git a/src/libmach/coff32/coff32del.c b/src/libmach/coff32/coff32del.c @@ -2,9 +2,9 @@ #include <stdlib.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" void coff32del(Obj *obj) diff --git a/src/libmach/coff32/coff32getidx.c b/src/libmach/coff32/coff32getidx.c @@ -1,9 +1,9 @@ #include <stdio.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" int coff32getidx(long *nsyms, char ***namep, long **offsp, FILE *fp) diff --git a/src/libmach/coff32/coff32getsec.c b/src/libmach/coff32/coff32getsec.c @@ -1,9 +1,9 @@ #include <stdio.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" static char * secname(Coff32 *coff, SCNHDR *scn) diff --git a/src/libmach/coff32/coff32getsym.c b/src/libmach/coff32/coff32getsym.c @@ -3,9 +3,9 @@ #include <string.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" static int typeof(Coff32 *coff, SYMENT *ent) diff --git a/src/libmach/coff32/coff32loadmap.c b/src/libmach/coff32/coff32loadmap.c @@ -1,9 +1,9 @@ #include <stdio.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" Map * coff32loadmap(Obj *obj, FILE *fp) diff --git a/src/libmach/coff32/coff32new.c b/src/libmach/coff32/coff32new.c @@ -2,10 +2,9 @@ #include <stdlib.h> #include <scc/mach.h> -#include <scc/scc.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" int coff32new(Obj *obj, int type) diff --git a/src/libmach/coff32/coff32probe.c b/src/libmach/coff32/coff32probe.c @@ -1,9 +1,9 @@ #include <stdio.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" int coff32probe(unsigned char *buf, char **name) diff --git a/src/libmach/coff32/coff32read.c b/src/libmach/coff32/coff32read.c @@ -6,9 +6,9 @@ #include <string.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" static void unpack_hdr(int order, unsigned char *buf, FILHDR *hdr) diff --git a/src/libmach/coff32/coff32setidx.c b/src/libmach/coff32/coff32setidx.c @@ -1,9 +1,9 @@ #include <stdio.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" int coff32setidx(long nsymbols, char *names[], long offs[], FILE *fp) diff --git a/src/libmach/coff32/coff32setsec.c b/src/libmach/coff32/coff32setsec.c @@ -4,9 +4,9 @@ #include <string.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" static char * secname(Coff32 *coff, SCNHDR *scn, Section *sec) diff --git a/src/libmach/coff32/coff32setsym.c b/src/libmach/coff32/coff32setsym.c @@ -4,9 +4,9 @@ #include <string.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" static int defent(Coff32 *coff, SYMENT *ent, Symbol *sym) diff --git a/src/libmach/coff32/coff32strip.c b/src/libmach/coff32/coff32strip.c @@ -2,9 +2,9 @@ #include <stdlib.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" int coff32strip(Obj *obj) diff --git a/src/libmach/coff32/coff32type.c b/src/libmach/coff32/coff32type.c @@ -2,9 +2,9 @@ #include <string.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" int coff32type(char *name) diff --git a/src/libmach/coff32/coff32write.c b/src/libmach/coff32/coff32write.c @@ -6,9 +6,9 @@ #include <string.h> #include <scc/mach.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" struct strtbl { char *s; diff --git a/src/libmach/coff32/coff32xgetidx.c b/src/libmach/coff32/coff32xgetidx.c @@ -4,9 +4,9 @@ #include <scc/mach.h> #include <scc/cstd.h> +#include <scc/coff32.h> #include "../libmach.h" -#include "coff32.h" int coff32xgetidx(int order, long *nsyms, char ***namep, long **offsp, FILE *fp)