-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
hold can now open archives (smartly!) and link against them. Also fix a few bugs found in the process. Signed-off-by: Pedro Falcato <[email protected]>
- Loading branch information
Showing
9 changed files
with
634 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
/* SPDX-License-Identifier: GPL-2.0-only */ | ||
/* Copyright (C) 2023 Pedro Falcato */ | ||
#ifndef ELF_AR_H | ||
#define ELF_AR_H | ||
|
||
#include <string.h> | ||
|
||
#define AR_MAGIC "!<arch>\n" | ||
#define ARFMAG "`\n" | ||
|
||
struct ar_hdr { | ||
char ar_name[16]; | ||
char ar_date[12]; | ||
char ar_uid[6]; | ||
char ar_gid[6]; | ||
char ar_mode[8]; | ||
char ar_size[10]; | ||
char ar_fmag[2]; | ||
}; | ||
|
||
static inline int is_ar_archive(const void *buf) | ||
{ | ||
return !memcmp(buf, AR_MAGIC, strlen(AR_MAGIC)); | ||
} | ||
|
||
struct input_file; | ||
struct symbol; | ||
|
||
int parse_ar(struct input_file *file, const void *mapping, unsigned long filesz); | ||
int resolve_lazy(struct symbol *sym); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.