tcc -ar: change mode to 644, use ARMAG

This commit is contained in:
noneofyourbusiness 2022-12-28 03:07:53 +01:00
parent 9957c686a4
commit d15dec711d
No known key found for this signature in database
GPG key ID: FF810A8659912F5A
2 changed files with 3 additions and 3 deletions

2
tcc.h
View file

@ -1509,7 +1509,7 @@ ST_DATA int func_bound_add_epilog;
#define TCC_OUTPUT_FORMAT_COFF 2 /* COFF */
#define TCC_OUTPUT_DYN TCC_OUTPUT_DLL
#define ARMAG "!<arch>\012" /* For COFF and a.out archives */
#define ARMAG "!<arch>\n" /* For COFF and a.out archives */
typedef struct {
unsigned int n_strx; /* index into string table of name */

View file

@ -197,7 +197,7 @@ finish:
funcmax = 250;
afpos = tcc_realloc(NULL, funcmax * sizeof *afpos); // 250 func
memcpy(&arhdro.ar_mode, "100666", 6);
memcpy(&arhdro.ar_mode, "100644", 6);
// i_obj = first input object file
while (i_obj < argc)
@ -302,7 +302,7 @@ finish:
if ((hofs & 1)) // align
hofs++, fpos = 1;
// write header
fwrite("!<arch>\n", 8, 1, fh);
fwrite(ARMAG, 8, 1, fh);
// create an empty archive
if (!funccnt) {
ret = 0;